#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire,OLED_RESET);
int16_t x, y;
uint16_t textWidth, textHeight;
const char strHello[] = "Hello Makers!";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
// initialize the OLED object
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Display Text
display.clearDisplay();
for(int i=0;i<=25;i++){
int xx=random(127);
int yy=random(63);
display.drawPixel(xx,yy,WHITE);
display.display();
delay(200);
}
delay(2000);
}
void loop() {
// put your main code here, to run repeatedly:
}