Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Manvi Mittal
- * Version 1
- * Leaning digital imputs
- */
- const int pinLed = 7;
- const int pinButton = 2;
- int readValue = 0;
- void setup()
- {
- // put your setup code here, to run once:
- pinMode (pinButton, INPUT);
- pinMode (pinLed, OUTPUT);
- Serial.begin (9600);
- digitalWrite (pinLed, HIGH);
- delay (50);
- digitalWrite (pinLed, LOW);
- }
- void loop()
- {
- // put your main code here, to run repeatedly:
- readValue = digitalRead (pinButton);
- if(readValue == 1)
- {
- digitalWrite (pinLed, HIGH);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement