Skip to content

Commit 1c13400

Browse files
author
Kirk
committed
added sfe splash
1 parent ae8a166 commit 1c13400

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

examples/Example-03_Bitmap/Example-03_Bitmap.ino

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const char * deviceName = "Micro OLED";
9191

9292
// Let's draw a truck - use our built in bitmap
9393
#include "res/qw_bmp_truck.h"
94+
#include "res/qw_bmp_sparkfun.h"
9495

9596

9697
int width;
@@ -100,6 +101,32 @@ int height;
100101
uint32_t draw_total_time;
101102
uint32_t n_draws;
102103

104+
////////////////////////////////////////////////////////////////////////////////////////////////
105+
// show_splash()
106+
//
107+
// Show SFE spash screen
108+
109+
void show_splash(){
110+
111+
112+
int x0 = (width - QW_BMP_SPARKFUN.width)/2;
113+
if(x0 < 0 )
114+
x0 = 0;
115+
116+
int y0 = (height - QW_BMP_SPARKFUN.height)/2;
117+
if(y0 < 0)
118+
y0=0;
119+
120+
myOLED.erase();
121+
myOLED.bitmap(x0, y0, QW_BMP_SPARKFUN);
122+
myOLED.display();
123+
delay(2000);
124+
}
125+
////////////////////////////////////////////////////////////////////////////////////////////////
126+
// setup()
127+
//
128+
// Standard Arduino setup routine
129+
103130
void setup(){
104131

105132
delay(500); //Give display time to power on
@@ -122,6 +149,8 @@ void setup(){
122149
width = myOLED.getWidth();
123150
height = myOLED.getHeight();
124151

152+
show_splash();
153+
125154
draw_total_time =0;
126155
n_draws=0;
127156

@@ -134,6 +163,11 @@ int iconXChangeAmount = 1;
134163
int iconY = 8;
135164
int iconYChangeAmount = 1;
136165

166+
////////////////////////////////////////////////////////////////////////////////////////////////
167+
// loop()
168+
//
169+
// Standard Arduino loop routine
170+
137171
void loop(){
138172

139173
// Calculate draw time...

0 commit comments

Comments
 (0)