#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <RF24.h>
#define leftVertPin A0
#define leftHoriPin A1
#define rightVertPin A2
#define rightHoriPin A3
#define leftSelPin 9
#define rightSelPin 6
#define screenHeight 128
#define screenWidth 64
#define I2CAddress 0x3C
#define OLEDReset -1
int leftXValue;
int leftYValue;
int rightXValue;
int rightYValue;
Adafruit_SSD1306 display(screenWidth, screenHeight, &Wire, OLEDReset);
void setup() {
// put your setup code here, to run once:
if(!display.begin(SSD1306_SWITCHCAPVCC, I2CAddress)) {
Serial.println("Failed to start!");
while (1);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
}
void loop() {
// put your main code here, to run repeatedly:
leftXValue = analogRead(leftHoriPin);
leftYValue = analogRead(leftVertPin);
rightXValue = analogRead(rightHoriPin);
rightYValue = analogRead(rightVertPin);
display.setCursor(0, 0);
display.print(leftXValue);
display.setCursor(0, 10);
display.print(leftYValue);
display.display();
delay(100);
}