NSWI170, 2026, Labs 04
Jáchym Bártík
int foo() {
if (condition1) {
if (condition2) {
// a...
}
else {
if (condition3) {
// b...
}
else {
// c...
}
}
}
else {
// d...
}
return x;
}
int foo() {
if (!condition1) {
// d...
return x;
}
if (condition2) {
// a...
return x;
}
else if (condition3) {
// b...
return x;
}
else {
// c...
return x;
}
}
int foo() {
if (!condition1) {
// d...
return x;
}
if (condition2) {
// a...
return x;
}
if (condition3) {
// b...
return x;
}
// c...
return x;
}
for cyklechloop
setup a loop
| DP | G | F | E | D | C | B | A |
| 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
shiftOut(SEG7_DATA_PIN, SEG7_CLOCK_PIN, MSBFIRST, 248); // Display digit 7 (11111000) ...
shiftOut(SEG7_DATA_PIN, SEG7_CLOCK_PIN, MSBFIRST, 5); // ... on positions 1 and 3 (0101)
digitalWrite(SEG7_LATCH_PIN, LOW); // Trigger the latch
digitalWrite(SEG7_LATCH_PIN, HIGH);
funshield.h
OUTPUTSEG7_DIGIT_GLYPHS[7] místo 248MSBFIRST určuje pořadí bitů
LSBFIRSTvoid displayDigit(int digit, int position)
digit je od 0 do 9position je od 0 do 3