Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define potXPin A0
- #define potYPin A1
- #define pbPin 3
- int pbValue = 0;
- int potXVal=0, potYVal=0;
- void setup ()
- {
- pinMode (pbPin , INPUT);
- Serial.begin (9600);
- }
- void loop ()
- {
- potXVal= analogRead (potXPin );
- potYVal= analogRead (potYPin );
- pbValue = digitalRead (pbPin );
- Serial.print("X = ");
- Serial.println (potXVal);
- Serial.print ("Y = ");
- Serial.println (potYVal);
- Serial.print("Button is ");
- if (pbValue == HIGH){
- Serial.println ("not pressed");
- }
- else{
- Serial.println ("PRESSED");
- }
- delay (500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement