Hi All,
I am new to Arduino environment, I was trying to use 128x64 oled with the digispark.
But I am unsure how to print a variable in it, I do see the text that can be entered as
enum {BufSize=9}; // If a is short use a smaller number, eg 5 or 6
char buf[BufSize];
oled.clear(); //all black
oled.setCursor(0, 0); //top left
oled.setFont(FONT8X16);
oled.print(F("Voltage")); //wrap strings in F() to save RAM!
oled.setFont(FONT6X8);
oled.setCursor(0, 2); //two rows down because the 8x16 font takes two rows of 8
volt = analogRead(analogPin);
volt=100;
snprintf (buf, BufSize, "%d", volt);
oled.println(buf); //println will move the cursor 8 or 16 pixels down (based on the front) and back to X=0
How can I print the value of the voltage that I read from the analog pin?
Thanks in Advance.