Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Button = 0;
- void setup()
- {
- pinMode(1, OUTPUT);
- pinMode(6, INPUT);
- pinMode(2, OUTPUT);
- pinMode(3, OUTPUT);
- pinMode(4, OUTPUT);
- pinMode(5, OUTPUT);
- }
- void loop()
- {
- digitalWrite(1, HIGH);
- Button = digitalRead(6);
- if (Button == HIGH) {
- digitalWrite(2, HIGH);
- }
- Button = digitalRead(6);
- if (Button == HIGH) {
- digitalWrite(3, HIGH);
- }
- Button = digitalRead(6);
- if (Button == HIGH) {
- digitalWrite(4, HIGH);
- }
- Button = digitalRead(6);
- if (Button == HIGH) {
- digitalWrite(5, HIGH);
- }
- delay(10); // Delay a little bit to improve simulation performance
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement