Stap 4: De programma-code
Hier is de code:
VOID Setup {}
pinMode (13, OUTPUT);
pinMode (12, OUTPUT);
pinMode (11, OUTPUT);
pinMode (10, OUTPUT);
pinMode (9, OUTPUT);
pinMode (8, OUTPUT);
pinMode (7, OUTPUT);
pinMode (6, OUTPUT);
}
void loop {}
One();
delay(1000);
Off();
Two();
delay(1000);
Off();
Three();
delay(1000);
Off();
Four();
delay(1000);
Off();
Five();
delay(1000);
Off();
Six();
delay(1000);
Off();
Seven();
delay(1000);
Off();
Eight();
delay(1000);
Off();
Nine();
delay(1000);
Off();
Zero();
delay(1000);
Off();
Point();
delay(5000);
Off();
}
ongeldig one() {}
digitalWrite (6, hoge);
digitalWrite (11, hoge);
}
ongeldig two() {}
digitalWrite (7, hoge);
digitalWrite (6, hoge);
digitalWrite (9, hoge);
digitalWrite (13, hoge);
digitalWrite (12, hoge);
}
ongeldig three() {}
digitalWrite (11, hoge);
digitalWrite (12, hoge);
digitalWrite (7, hoge);
digitalWrite (6, hoge);
digitalWrite (9, hoge);
}
ongeldig four() {}
digitalWrite (11, hoge);
digitalWrite (8, hoge);
digitalWrite (6, hoge);
digitalWrite (9, hoge);
}
ongeldig five() {}
digitalWrite (11, hoge);
digitalWrite (12, hoge);
digitalWrite (7, hoge);
digitalWrite (8, hoge);
digitalWrite (9, hoge);
}
ongeldig six() {}
digitalWrite (13, hoge);
digitalWrite (12, hoge);
digitalWrite (11, hoge);
digitalWrite (9, hoge);
digitalWrite (8, hoge);
digitalWrite (7, hoge);
}
ongeldig seven() {}
digitalWrite (11, hoge);
digitalWrite (7, hoge);
digitalWrite (6, hoge);
}
ongeldig eight() {}
digitalWrite (13, hoge);
digitalWrite (12, hoge);
digitalWrite (11, hoge);
digitalWrite (9, hoge);
digitalWrite (8, hoge);
digitalWrite (7, hoge);
digitalWrite (6, hoge);
}
ongeldig nine() {}
digitalWrite (12, hoge);
digitalWrite (11, hoge);
digitalWrite (9, hoge);
digitalWrite (8, hoge);
digitalWrite (7, hoge);
digitalWrite (6, hoge);
}
ongeldig zero() {}
digitalWrite (13, hoge);
digitalWrite (12, hoge);
digitalWrite (11, hoge);
digitalWrite (8, hoge);
digitalWrite (7, hoge);
digitalWrite (6, hoge);
}
ongeldig point() {}
digitalWrite (10, hoge);
}
ongeldig off() {}
digitalWrite (13, laag);
digitalWrite (12, laag);
digitalWrite (11, laag);
digitalWrite (10, laag);
digitalWrite (9, laag);
digitalWrite (8, laag);
digitalWrite (7, laag);
digitalWrite (6, laag);
}