#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0); // I2C / TWI
const int SCREEN_WIDTH = 128;
const int SCREEN_HEIGHT = 64;
float radius = min(SCREEN_HEIGHT, SCREEN_WIDTH) / 2 - 1;
const int X_CENTER = SCREEN_WIDTH / 2;
const int Y_CENTER = SCREEN_HEIGHT / 2;
void draw(void) {
// Increase OLED brightness
u8g.setContrast(255); // Set the OLED brightness to maximum
// Draw 4 concentric circles with a common center
for (int i = 0; i < 4; i++) {
u8g.drawCircle(X_CENTER, Y_CENTER, radius - (i * 10));
}
// Print "Modified by Arvind" in the empty space of OLED
u8g.setFont(u8g_font_chikita);
//u8g.drawStr(0, 50, "Modified ");
delay(800);
u8g.drawStr(0, 60, "by Arvind");
delay(800);
u8g.drawStr(0, 10, "concentric");
delay(800);
u8g.drawStr(0, 20, "circles");
delay(800);
}
void setup(void) {
// flip screen, if required
// u8g.setRot180();
}
void loop(void) {
u8g.firstPage();
do {
draw();
} while (u8g.nextPage());
// Rebuild the picture after some delay
delay(500);
}