Source Arduino Uno With 0.96″ OLED Display

 
#include <Wire.h>
#include <SeeedOLED.h>
int sensorPin = A0;
int sensorValue = 0;
int telling;
String q;
void setup() {
Wire.begin();
SeeedOled.init(); //initialze SEEED OLED display
SeeedOled.clearDisplay(); //clear the screen and set start position to top left corner
SeeedOled.setNormalDisplay(); //Set display to normal mode (i.e non-inverse mode)
SeeedOled.setPageMode(); //Set addressing mode to Page Mode
SeeedOled.setTextXY(0,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(“Starting Up..”); //Print the String
SeeedOled.setTextXY(6,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(“Q-Strip Demo”); //Print the String
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
//SerialUSB.print(“sensor = ” );
//SerialUSB.println(sensorValue);
q = String(analogRead(sensorPin));
telling = telling + 1;
String qstripString = String(q);
int length = qstripString.length()+1;
char qlevel[length];
qstripString.toCharArray(qlevel, sizeof(qlevel));
if (telling == 60){
bool result = false;
SeeedOled.setTextXY(0,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(“** **”); //Print the String
telling = 1; ///reset count
}
SeeedOled.setTextXY(0,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(” Q-Strip DEMO”); //Print the String
SeeedOled.setTextXY(3,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(” Value “); //Print the String
SeeedOled.setTextXY(3,12); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(” “); //Print the String
SeeedOled.setTextXY(3,12); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(qlevel); //Print the String
//SeeedOled.setTextXY(4,0); //Set the cursor to Xth Page, Yth Column
//SeeedOled.putString(“LoRa active”); //Print the String
SeeedOled.setTextXY(6,0); //Set the cursor to Xth Page, Yth Column
SeeedOled.putString(” www.q-strip.com “); //Print the String
delay(200);
}