Want to Display OLED SSD1306 wirelessly

Hello everyone ...
I hope that you are good and doing well.

I want to display the values from the OLED wirelessly and I need you to make some changes in my code; I also have two Arduinos and currently I am using this this code to see the values on an OLED display with wire.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{ B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000 };

#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif





//BATTERY READINGS VARIABLES
const int Battery = A0;
float Voltage = 0.0; //input battery voltage
float Voltage1 = 0.0; //output voltage for analog pin A0
float R1 = 74000; // R1 =47k ohms and 27k ohms resistors
float R2 = 10000; // R2 =10k ohms resistor 
int readValue = 0;
long previousMillis_battery = 0;
byte Bat_start_timer = 0;
int battery_wait;
unsigned long currentMillis = 0; // VALID FOR ALL FUNCTIONS(COUNTER)

//BATTERY FUNCTION
void battery()
{
 readValue = analogRead(Battery);
 Voltage1 = readValue * (5.0 / 1023.0); 
 Voltage = Voltage1 / (R2/(R1+R2));
 if(Bat_start_timer == 0) battery_wait = 2000;
 if(currentMillis - previousMillis_battery > battery_wait) {
//    Serial.println("Battery Voltages,"); Serial.print(Voltage); Serial.print(",V,");
  previousMillis_battery = currentMillis;
    battery_wait = 2000; Bat_start_timer = 1; }

} // battery FUNCTION END

void setup()
{
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  display.display();
  delay(2000);
  display.clearDisplay(); // Clear the buffer.
}


void loop()
{

//   currentMillis=millis(); // if you want to see the voltages on serial monitor then open this one
//   battery();

   
  display.setTextSize(1.5);
  display.setTextColor(WHITE);
  display.setCursor(1,4);
  display.println("ABC System Started");

  battery();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(28,18);
  display.print (Voltage);
  display.println("V");
  display.display();
  delay(2000);
  display.clearDisplay();
}

I am using an external radio module for my transmitter and receiver using a serial port TX0, and RX0 so no need of library

Thank you soo much

There's a guy here with a very similar-sounding problem

1 Like

Yes .. its me :slight_smile: that was not wireless and that worked finished successfully; now its time to see it wirelessly

What ever radio module you are using, and you dont say, will probably have a library for it and that library will likely have examples on how to send and receive data.

No, without any library its working via serial communication port ...