2
2
Micro OLED Display Icon
3
3
Nathan Seidle @ SparkFun Electronics
4
4
Original Creation Date: November 15, 2020
5
-
6
- Draw a variable sized icon anywhere on the display. This is helpful
5
+
6
+ Draw a variable sized icon anywhere on the display. This is helpful
7
7
when you need a icon (GPS, battery, etc) on a certain part of the screen.
8
8
9
9
This example assumes an I2C connection (Qwiic)
10
-
11
- This code is beerware; if you see me (or any other SparkFun
12
- employee) at the local, and you've found our code helpful,
10
+
11
+ This code is beerware; if you see me (or any other SparkFun
12
+ employee) at the local, and you've found our code helpful,
13
13
please buy us a round!
14
-
14
+
15
15
Distributed as-is; no warranty is given.
16
16
*/
17
17
#include < Wire.h>
@@ -80,6 +80,13 @@ void setup()
80
80
delay (100 );
81
81
Serial.println (" Display Icon OLED example" );
82
82
83
+ // Some unbranded displays seem to need a reset before they can be detected successfully:
84
+ pinMode (PIN_RESET, OUTPUT);
85
+ digitalWrite (PIN_RESET, LOW);
86
+ delay (100 );
87
+ digitalWrite (PIN_RESET, HIGH);
88
+ delay (100 );
89
+
83
90
// 0x3D is default address on Qwiic board
84
91
if (isConnected (0x3D ) == true || isConnected (0x3C ) == true )
85
92
{
@@ -136,4 +143,4 @@ bool isConnected(uint8_t deviceAddress)
136
143
if (Wire.endTransmission () == 0 )
137
144
return true ;
138
145
return false ;
139
- }
146
+ }
0 commit comments