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:
2019-05-30 23:41:53 +02:00
parent 2d047634f2
commit 6c84b31f2c
1480 changed files with 198581 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
#include "JoystickController.h"
JoystickController controller;
void setup(){
Serial.begin(9600);
}
void loop(){
controller.update();
if (controller.selectButtonPressed()){
Serial.println("S");
}
if (controller.upButtonPressed()){
Serial.println("U");
}
if (controller.downButtonPressed()){
Serial.println("D");
}
if (controller.leftButtonPressed()){
Serial.println("L");
}
if (controller.rightButtonPressed()){
Serial.println("R");
}
int direct = controller.getDirection();
switch (direct){
case JoystickController::DIRECTION_UP:
Serial.println("UP");
break;
case JoystickController::DIRECTION_UP_RIGHT:
Serial.println("UP-RIGHT");
break;
case JoystickController::DIRECTION_RIGHT:
Serial.println("RIGHT");
break;
case JoystickController::DIRECTION_DOWN_RIGHT:
Serial.println("DOWN-RIGHT");
break;
case JoystickController::DIRECTION_DOWN:
Serial.println("DOWN");
break;
case JoystickController::DIRECTION_DOWN_LEFT:
Serial.println("DOWN-LEFT");
break;
case JoystickController::DIRECTION_LEFT:
Serial.println("LEFT");
break;
case JoystickController::DIRECTION_UP_LEFT:
Serial.println("UP-LEFT");
break;
}
delay(100);
}