Skip to content

Commit df01061

Browse files
Fixes for horizontal flips. This acheives MVP for the 1in5 display.
All examples seem to be working well.
1 parent a95b72c commit df01061

File tree

13 files changed

+155
-158
lines changed

13 files changed

+155
-158
lines changed

examples/Example-01_Hello/Example-01_Hello.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Transparent OLED https://www.sparkfun.com/products/15173
1010
"Narrow" OLED https://www.sparkfun.com/products/24606
1111
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
12+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1213
1314
Written by Kirk Benell @ SparkFun Electronics, March 2022
1415
@@ -30,7 +31,7 @@ QwiicMicroOLED myOLED;
3031
//QwiicTransparentOLED myOLED;
3132
//QwiicNarrowOLED myOLED;
3233
//Qwiic1in3OLED myOLED;
33-
34+
//Qwiic1in5OLED myOLED;
3435

3536
void setup()
3637
{

examples/Example-02_Shapes/Example-02_Shapes.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Written by Kirk Benell @ SparkFun Electronics, March 2022
1920
@@ -35,6 +36,7 @@ QwiicMicroOLED myOLED;
3536
//QwiicTransparentOLED myOLED;
3637
//QwiicNarrowOLED myOLED;
3738
//Qwiic1in3OLED myOLED;
39+
//Qwiic1in5OLED myOLED;
3840

3941
// Global variables - used to stash our screen size
4042

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Written by Kirk Benell @ SparkFun Electronics, March 2022
1920
@@ -35,6 +36,7 @@ QwiicMicroOLED myOLED;
3536
//QwiicTransparentOLED myOLED;
3637
//QwiicNarrowOLED myOLED;
3738
//Qwiic1in3OLED myOLED;
39+
//Qwiic1in5OLED myOLED;
3840

3941
// Let's draw a truck - use our built in bitmap
4042
#include "res/qw_bmp_truck.h"

examples/Example-04_Text/Example-04_Text.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Written by Kirk Benell @ SparkFun Electronics, March 2022
1920
@@ -35,6 +36,7 @@ QwiicMicroOLED myOLED;
3536
//QwiicTransparentOLED myOLED;
3637
//QwiicNarrowOLED myOLED;
3738
//Qwiic1in3OLED myOLED;
39+
//Qwiic1in5OLED myOLED;
3840

3941
// Fonts
4042
#include <res/qw_fnt_5x7.h>

examples/Example-05_ScrollFlip/Example-05_ScrollFlip.ino

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Transparent OLED https://www.sparkfun.com/products/15173
1717
"Narrow" OLED https://www.sparkfun.com/products/24606
1818
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
19+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1920
2021
Written by Kirk Benell @ SparkFun Electronics, March 2022
2122
@@ -37,32 +38,38 @@ QwiicMicroOLED myOLED;
3738
//QwiicTransparentOLED myOLED;
3839
//QwiicNarrowOLED myOLED;
3940
//Qwiic1in3OLED myOLED;
41+
//Qwiic1in5OLED myOLED;
42+
43+
// Get the end page based on the type of myOLED. If it is 1.5" OLED with 128 rows (15 pages),
44+
// the end page is 15 otherwise we'll pass 7 (for displays with only 64 rows)
45+
int endPage = 7;
46+
// int endPage = 15; // Only use for 1.5" OLED
4047

4148
int yoffset;
4249

4350
// Our testing functions
4451
void scrollRight(void)
4552
{
4653
myOLED.scrollStop();
47-
myOLED.scrollRight(0, 7, SCROLL_INTERVAL_2_FRAMES);
54+
myOLED.scrollRight(0, endPage, SCROLL_INTERVAL_2_FRAMES);
4855
}
4956

5057
void scrollRightVertical(void)
5158
{
5259
myOLED.scrollStop();
53-
myOLED.scrollVertRight(0, 7, SCROLL_INTERVAL_3_FRAMES);
60+
myOLED.scrollVertRight(0, endPage, SCROLL_INTERVAL_3_FRAMES);
5461
}
5562

5663
void scrollLeft(void)
5764
{
5865
myOLED.scrollStop();
59-
myOLED.scrollLeft(0, 7, SCROLL_INTERVAL_4_FRAMES);
66+
myOLED.scrollLeft(0, endPage, SCROLL_INTERVAL_4_FRAMES);
6067
}
6168

6269
void scrollLeftVertical(void)
6370
{
6471
myOLED.scrollStop();
65-
myOLED.scrollVertLeft(0, 7, SCROLL_INTERVAL_5_FRAMES);
72+
myOLED.scrollVertLeft(0, endPage, SCROLL_INTERVAL_5_FRAMES);
6673
}
6774

6875
void scrollStop(void)
@@ -107,9 +114,9 @@ typedef struct _testRoutines
107114

108115
static const testRoutine testFunctions[] = {
109116
{scrollRight, "Right>"},
110-
{scrollRightVertical, "^Right-Up>"},
117+
{scrollRightVertical, "^Vertical-Mode1>"}, // Right-Up for most displays, Up for 1.5" display
111118
{scrollLeft, "<Left"},
112-
{scrollLeftVertical, "<Left-Up^"},
119+
{scrollLeftVertical, "<Vertical-Mode2^"}, // Left-Up for most displays, Down for 1.5" display
113120
{scrollStop, "<STOP>"},
114121
{flipHorizontal, "-Flip-Horz-"},
115122
{flipVertical, "|Flip-Vert|"},

examples/Example-06_Clock/Example-06_Clock.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Written by
1920
Jim Lindblom @ SparkFun Electronics
@@ -37,6 +38,7 @@ QwiicMicroOLED myOLED;
3738
//QwiicTransparentOLED myOLED;
3839
//QwiicNarrowOLED myOLED;
3940
//Qwiic1in3OLED myOLED;
41+
//Qwiic1in5OLED myOLED;
4042

4143
// Use these variables to set the initial time
4244
int hours = 11;

examples/Example-07_Cube/Example-07_Cube.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Written by
1920
Jim Lindblom @ SparkFun Electronics
@@ -36,6 +37,7 @@ QwiicMicroOLED myOLED;
3637
//QwiicTransparentOLED myOLED;
3738
//QwiicNarrowOLED myOLED;
3839
//Qwiic1in3OLED myOLED;
40+
//Qwiic1in5OLED myOLED;
3941

4042
int width;
4143
int height;

examples/Example-08_Multi/Example-08_Multi.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Transparent OLED https://www.sparkfun.com/products/15173
1515
"Narrow" OLED https://www.sparkfun.com/products/24606
1616
Qwiic OLED 1.3in https://www.sparkfun.com/products/23453
17+
Qwiic OLED 1.5in https://www.sparkfun.com/products/29530
1718
1819
Updated from example writtin by Paul Clark @ SparkFun Electronics
1920
Original Creation Date: December 11th, 2020
@@ -36,6 +37,7 @@ QwiicMicroOLED myOLED;
3637
//QwiicTransparentOLED myOLED;
3738
//QwiicNarrowOLED myOLED;
3839
//Qwiic1in3OLED myOLED;
40+
//Qwiic1in5OLED myOLED;
3941

4042
int width;
4143
int height;

src/SparkFun_Qwiic_OLED.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ template <typename DeviceType> class QwiicOLEDBaseClass : public Print // NOTE:
276276
//
277277
// Parameter Description
278278
// --------- -----------------------------
279-
// start The start page address of the scroll - valid values are 0 thru 7
280-
// stop The stop/end page address of the scroll - valid values are 0 thru 7
279+
// start The start page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
280+
// stop The stop/end page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
281281
// interval The time interval between scroll step - values listed below
282282
//
283283
// Defined values for the interval parameter:
@@ -308,8 +308,8 @@ template <typename DeviceType> class QwiicOLEDBaseClass : public Print // NOTE:
308308
//
309309
// Parameter Description
310310
// --------- -----------------------------
311-
// start The start page address of the scroll - valid values are 0 thru 7
312-
// stop The stop/end page address of the scroll - valid values are 0 thru 7
311+
// start The start page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
312+
// stop The stop/end page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
313313
// interval The time interval between scroll step - values listed in scrollRight()
314314

315315
void scrollVertRight(uint8_t start, uint8_t stop, uint8_t interval)
@@ -327,8 +327,8 @@ template <typename DeviceType> class QwiicOLEDBaseClass : public Print // NOTE:
327327
//
328328
// Parameter Description
329329
// --------- -----------------------------
330-
// start The start page address of the scroll - valid values are 0 thru 7
331-
// stop The stop/end page address of the scroll - valid values are 0 thru 7
330+
// start The start page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
331+
// stop The stop/end page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
332332
// interval The time interval between scroll step - values listed in scrollRight()
333333

334334
void scrollLeft(uint8_t start, uint8_t stop, uint8_t interval)
@@ -346,8 +346,8 @@ template <typename DeviceType> class QwiicOLEDBaseClass : public Print // NOTE:
346346
//
347347
// Parameter Description
348348
// --------- -----------------------------
349-
// start The start page address of the scroll - valid values are 0 thru 7
350-
// stop The stop/end page address of the scroll - valid values are 0 thru 7
349+
// start The start page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
350+
// stop The stop/end page address of the scroll - valid values are 0 thru 15 (only 0 thru 7 valid for most small displays w/ SSD1306)
351351
// interval The time interval between scroll step - values listed in scrollRight()
352352

353353
void scrollVertLeft(uint8_t start, uint8_t stop, uint8_t interval)

0 commit comments

Comments
 (0)