Displaying data on WaveShare1.5inch RGB OLED Module

Hello,

It is my first time on this forum and doing extensive work with the Arduino Uno R3. I am working on a project and having a problem in displaying the analog data I am receiving sending it to my WaveShare1.5inch RGB OLED Module. I have the correct drivers and controller ( it uses the SSD1351 controller).

I have managed to make changes to the .ino file but it isn't displaying. I would like to share two pieces of sample code. 1 is for the display and the second is the one I am using for my input. Thank you in advance.

OLED Display:

#include "OLED_Driver.h"
#include "GUI_paint.h"
#include "DEV_Config.h"
#include "Debug.h"
#include "ImageData.h"

const int analogPin1 = 0;
const int analogPin2 = 1;
const int analogPin3 = 2;
const int analogPin4 = 3;
const int analogPin5 = 4;
const int analogPin6 = 5;

void setup() {
System_Init();
if(USE_IIC)
{
Serial.print("Only USE_SPI_4W, Please revise DEV_config.h !!!");
return 0;
Serial.begin(9600);
}

Serial.print(F("OLED_Init()...\r\n"));
OLED_1in5_rgb_Init();
Driver_Delay_ms(500);
OLED_1in5_rgb_Clear();

//1.Create a new image size
UBYTE *BlackImage;
Serial.print("Paint_NewImage\r\n");
Paint_NewImage(BlackImage, OLED_1in5_RGB_WIDTH, OLED_1in5_RGB_HEIGHT, 270, BLACK);
Paint_SetScale(65);

Serial.print("Drawing:page 2\r\n");
for(UBYTE i=0; i<16; i++)

{
Paint_DrawRectangle(0, i*8, 127, (i+1)8, i4095, DOT_PIXEL_1X1, DRAW_FILL_FULL);
}

Driver_Delay_ms(5000);
OLED_1in5_rgb_Clear();

while(1) {

Serial.print("Drawing:page 3\r\n");     
Paint_DrawString_EN(0, 0, "F-150 Lightning", &Font12, BLACK, BLUE);
Paint_DrawString_EN(0, 20,"Conn 1: ", &Font12, BLACK, CYAN);
 int reading1 = analogRead(analogPin1);
 float voltage1 = reading1 / 204.6;
 Serial.print(reading1);
Paint_DrawString_EN(0, 30,"Conn 2: ", &Font12, BLACK, CYAN);
Paint_DrawString_EN(0, 40,"Conn 3: ", &Font12, BLACK, CYAN);
Paint_DrawString_EN(0, 50,"Conn 4: ", &Font12, BLACK, CYAN);
Paint_DrawString_EN(0, 60,"Conn 5: ", &Font12, BLACK, CYAN); 
Paint_DrawString_EN(0, 70,"Conn 6: ", &Font12, BLACK, CYAN);
Paint_DrawString_EN(0, 115,"R&E Automated", &Font12, BLACK, GREEN);
Driver_Delay_ms(5000);    
OLED_1in5_rgb_Clear();   
  }   

}

void loop() {

}

ANALOG DATA INPUT

// Continuity Analog Input

const int analogPin1 = 0;
const int analogPin2 = 1;
const int analogPin3 = 2;
const int analogPin4 = 3;
const int analogPin5 = 4;
const int analogPin6 = 5;

void setup()
{
Serial.begin(9600);
}
void loop()
{
int reading1 = analogRead(analogPin1);
float voltage1 = reading1 / 204.6;
Serial.print("Reading1=");
Serial.print(reading1);
Serial.print("\t\tVolts1=");
Serial.println(voltage1);
delay(4000);

int reading2 = analogRead(analogPin2);
float voltage2 = reading2 / 204.6;
Serial.print("Reading2=");
Serial.print(reading2);
Serial.print("\t\tVolts2=");
Serial.println(voltage2);
delay(4000);

int reading3 = analogRead(analogPin3);
float voltage3 = reading3 / 204.6;
Serial.print("Reading3=");
Serial.print(reading3);
Serial.print("\t\tVolts3=");
Serial.println(voltage3);
delay(4000);

int reading4 = analogRead(analogPin4);
float voltage4 = reading4 / 204.6;
Serial.print("Reading4=");
Serial.print(reading4);
Serial.print("\t\tVolts4=");
Serial.println(voltage4);
delay(4000);

int reading5 = analogRead(analogPin5);
float voltage5 = reading5 / 204.6;
Serial.print("Reading5=");
Serial.print(reading5);
Serial.print("\t\tVolts5=");
Serial.println(voltage5);
delay(4000);

int reading6 = analogRead(analogPin6);
float voltage6 = reading6 / 204.6;
Serial.print("Reading6=");
Serial.print(reading6);
Serial.print("\t\tVolts6=");
Serial.println(voltage6);
delay(4000);
}

I hope this makes sense. Thanks

Ummmmm.

Is the display displaying anything.
Or is your issue displaying analog data?

Another library is available:
https://forum.arduino.cc/t/ssd1351-rgb-oled-waveshare-1-5inch-display-issue/596879

I get a display with no issues. In the display portion of my code, it displays Conn 1:, Conn 2: etc. When I tried adding the code from the second part, it will not display. I'm almost certain I'm not using a proper command parameter but not 100% sure.

Did you read David's response?

David_prentice
Jun '19
Ah-ha. You are already using Adafruit_SSD1351 library. So you use regular Adafruit_GFX methods e.g.
oled.setTextColor(WHITE, BLACK); //specifying background colour make text draw with background

> Note that this only works for the default 5x7 font. FreeFonts always print in transparent mode.

David

I have read David's response, but there was no change. Still no output. I am looking at the display parameters again.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.