Dear all,
Happy to be a part of this community.
Playing around with arduino for the past couple of hours and getting some issues you may advice.
I want to input ttl signal to my nano and display it (the raw string of data (ASCII)) on my OLED screen.
I have no issues with the OLED dislay drivers, as U8GLIB worked very well for me.
i can input the signal to the arduino and read it on my laptop in the serial monitor.
But i dont understand how to make the data show on the screen.
Any suggestions?
The code i used so far is
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(4800);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// initialize the serial communications:
Serial.begin(9600);
}
void loop() {
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}