Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo steering;
- void setup(){
- pinMode(3,INPUT);
- pinMode(A0,INPUT);
- pinMode(A1,INPUT);
- steering.attach(9);
- Serial.begin(9600);
- Serial.write("The Game is Started!");
- }
- void loop(){
- int buttonState = digitalRead(3);
- int x = analogRead(A0);
- int y = analogRead(A1);
- if(buttonState==1)
- {
- Serial.println("Button is Pressed");
- buttonState=0;
- }
- Serial.print("x = ");
- Serial.print(x);
- Serial.print(" - y = ");
- Serial.println(y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement