mirror of
https://github.com/KevinMidboe/Arduino.git
synced 2025-10-29 17:40:11 +00:00
Init commit with many years of arduino sketches and projects. I dont know if the esp8266 includes much, but there are also libraries. I hope they dont have crazy automatic versioning through the Arduino IDE.
This commit is contained in:
31
Projects/Tea-duino Main/Joystick_DirectionPrint/Joystick_DirectionPrint.ino
Executable file
31
Projects/Tea-duino Main/Joystick_DirectionPrint/Joystick_DirectionPrint.ino
Executable 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