Advertisement
carrots084

Arduino Code

Apr 16th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. int ledPin = 9;
  2. int sensePin = 2;
  3. int ledPinX = 7;
  4. int inputPin = 1;
  5.  
  6.  
  7.  
  8. void setup() {
  9. Serial.begin(9600);
  10. pinMode(ledPin, OUTPUT);
  11. pinMode(inputPin, INPUT);
  12. pinMode(ledPinX, OUTPUT);
  13.  
  14. // val = digitalRead(inputPin);
  15. }
  16.  
  17. void loop() {
  18. int val;
  19. val = digitalRead(inputPin);
  20. digitalWrite(ledPinX, val);
  21.  
  22. }
  23. //If you know about arduinos: help me out at http://arduino.stackexchange.com/questions/1189/why-does-my-wired-button-always-read-high
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement