Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int cny=5;
- unsigned long cnyon;
- int led=13;
- void setup (){
- pinMode (cny, INPUT);
- pinMode (led, OUTPUT);
- Serial.begin (9600);
- }
- void loop () {
- cnyon= digitalRead (cny);
- Serial.println (cnyon);
- if (cnyon != 0){
- digitalWrite (led,HIGH);
- }
- else {
- digitalWrite (led, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement