Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <RCSwitch.h>
- int x = 0;
- int y = 0;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- pinMode(D6,OUTPUT);
- pinMode(D5,OUTPUT);
- pinMode(A0,INPUT_PULLUP);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- digitalWrite(D6,HIGH);
- digitalWrite(D5,LOW);
- delay(10);
- x = analogRead(A0);
- digitalWrite(D6,LOW);
- digitalWrite(D5,HIGH);
- delay(10);
- y = analogRead(A0);
- Serial.println("Values:");
- Serial.print("x: ");
- Serial.print(x);
- Serial.print(" y: ");
- Serial.println(y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement