void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ROV DRIVER!");
}
void loop() {
// #define VERT_PIN 0
#define HORZ_PIN 2
#define SEL_PIN 4
void setup() {
pinMode(2, INPUT);
pinMode(0, INPUT);
pinMode(4, INPUT_PULLUP);
}
void loop() {
int vert = analogRead(VERT_PIN);
int horz = analogRead(HORZ_PIN);
bool selPressed = digitalRead(SEL_PIN) == LOW;
// horz goes from 0 (right) to 1023 (left)
// vert goes from 0 (bottom) to 1023 (top)
// selPressed is true is the joystick is pressed
}:
delay(10); // this speeds up the simulation
}