mirror of
https://github.com/KevinMidboe/Tea-Duino_Main.git
synced 2025-10-29 18:00:16 +00:00
Master_0
This commit is contained in:
31
Joystick_DirectionPrint/Joystick_DirectionPrint.ino
Normal file
31
Joystick_DirectionPrint/Joystick_DirectionPrint.ino
Normal file
@@ -0,0 +1,31 @@
|
||||
int UD = 0;
|
||||
int LR = 0;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
UD = analogRead(A0);
|
||||
LR = analogRead(A1);
|
||||
if (UD == 0)
|
||||
{
|
||||
Serial.println("This is down!");
|
||||
}
|
||||
else
|
||||
if (UD == 1023)
|
||||
{
|
||||
Serial.println("This is up!");
|
||||
}
|
||||
else
|
||||
if (LR == 0)
|
||||
{
|
||||
Serial.println("This is Left!");
|
||||
}
|
||||
else
|
||||
if (LR == 1023)
|
||||
{
|
||||
Serial.println("This is Right!");
|
||||
}
|
||||
delay(10);
|
||||
}
|
||||
Reference in New Issue
Block a user