123456789101112131415161718192021222324 |
- /* Analog input pins for Joystick XY values */
- const int JoyStick_X = 0; // pin number for x
- const int JoyStick_Y = 1; // pin number for y
- /* Joystick sensitivity */
- // We define a JoysStick sensitivity to declare that a movement wish
- // is communicated from the user.
- // We consider only 4 possibilities:
- // foward (++) or backwards (--) for each degree of freedom (X and Y)
- const int threshold = 64;
- void setup() {
- // Initialize the Serial Port
- Serial.begin(9600); // 9600 bps
- }
- void loop() {
- Serial.print(analogRead(JoyStick_X));
- Serial.print("\t");
- Serial.print(analogRead(JoyStick_Y));
- Serial.print("\n");
- }
|