// Test for minimum program size.
// Edit AVRI2C_FASTMODE in SSD1306Ascii.h to change the default I2C frequency.
#include "SSD1306Ascii.h"
#include "SSD1306AsciiAvrI2c.h"
// 0X3C+SA0 - 0x3C or 0x3D
#define I2C_ADDRESS 0x3C
// Define proper RST_PIN if required.
#define RST_PIN -1
SSD1306AsciiAvrI2c oled;
float ch1,ch2,ch3,ch4;
int ch01,ch02,ch03,ch04;
void setup() {
#if RST_PIN >= 0
oled.begin(&Adafruit128x64, I2C_ADDRESS, RST_PIN);
#else // RST_PIN >= 0
oled.begin(&Adafruit128x64, I2C_ADDRESS);
#endif // RST_PIN >= 0
// Call oled.setI2cClock(frequency) to change from the default frequency.
//oled.setFont(System5x7);
oled.setFont(fixed_bold10x15);
oled.clear();
oled.setCursor(0,0); oled.print("1: bar");
oled.setCursor(0,2); oled.print("2: bar");
oled.setCursor(0,4); oled.print("3: bar");
oled.setCursor(0,6); oled.print("4: bar");
}
void loop() {
ch01=analogRead(A0);
ch02=analogRead(A1);
ch03=analogRead(A2);
ch04=analogRead(A3);
ch1=(375/1023.0)*ch01-75;
ch2=(375/1023.0)*ch02-75;
ch3=(375/1023.0)*ch03-75;
ch4=(375/1023.0)*ch04-75;
//oled.setCursor(64,0); oled.print(" ");
oled.clearField(64,0,3); oled.setCursor(24,0); oled.print(ch1,2);
// oled.setCursor(64,2); oled.print(" ");
oled.clearField(64,2,3); oled.setCursor(24,2); oled.print(ch2,2);
// oled.setCursor(64,4); oled.print(" ");
oled.clearField(64,4,3); oled.setCursor(24,4); oled.print(ch3,2);
// oled.setCursor(64,6); oled.print(" ");
oled.clearField(64,6,3); oled.setCursor(24,6); oled.print(ch4,2);
delay(800);
}