Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int readVal;
- const int led = pinNo;
- const int button = pinNo;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- pinMode(led, OUTPUT);
- pinMode(button, INPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- readVal= digitalRead(button);
- Serial.println(readVal);
- if (readVal == 1) //rememner double == and && in if statements.
- {
- digitalWrite(led, HIGH);
- }
- digitalWrite(led, LOW);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement