@@ -10,7 +10,7 @@ extern Adafruit_TestBed TB;
10
10
Arduino_XCA9554SWSPI *expander = new Arduino_XCA9554SWSPI(
11
11
PCA_TFT_RESET, PCA_TFT_CS, PCA_TFT_SCK, PCA_TFT_MOSI,
12
12
&Wire, 0x3F );
13
-
13
+
14
14
Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
15
15
TFT_DE, TFT_VSYNC, TFT_HSYNC, TFT_PCLK,
16
16
TFT_R1, TFT_R2, TFT_R3, TFT_R4, TFT_R5,
@@ -26,20 +26,20 @@ Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
26
26
expander, GFX_NOT_DEFINED /* RST */ , TL021WVC02_init_operations, sizeof (TL021WVC02_init_operations));
27
27
28
28
uint16_t *colorWheel;
29
-
29
+
30
30
void setup (void )
31
- {
31
+ {
32
32
Serial.begin (115200 );
33
33
// while (!Serial) delay(100);
34
-
34
+
35
35
#ifdef GFX_EXTRA_PRE_INIT
36
36
GFX_EXTRA_PRE_INIT ();
37
37
#endif
38
38
39
39
Serial.println (" Beginning" );
40
40
// Init Display
41
41
42
- Wire.setClock (1000000 ); // speed up I2C
42
+ Wire.setClock (1000000 ); // speed up I2C
43
43
if (!gfx->begin ()) {
44
44
Serial.println (" gfx->begin() failed!" );
45
45
}
@@ -61,7 +61,7 @@ uint8_t allpins[] = {SS, SCK, MOSI, MISO, A1, A0};
61
61
62
62
bool test = false ;
63
63
void loop ()
64
- {
64
+ {
65
65
if (!test) {
66
66
gfx->draw16bitRGBBitmap (0 , 0 , colorWheel, 480 , 480 );
67
67
delay (100 );
@@ -83,7 +83,7 @@ void loop()
83
83
84
84
gfx->setCursor (100 , gfx->height () / 2 - 75 );
85
85
gfx->println (" I2C OK!" );
86
-
86
+
87
87
gfx->setCursor (100 , gfx->height () / 2 - 25 );
88
88
gfx->setTextColor (RED);
89
89
gfx->println (" RED" );
@@ -104,11 +104,10 @@ void loop()
104
104
void generateColorWheel (uint16_t *colorWheel) {
105
105
float angle;
106
106
uint8_t r, g, b;
107
- int index, scaled_index;
107
+ int scaled_index;
108
108
109
109
for (int y = 0 ; y < 240 ; y++) {
110
110
for (int x = 0 ; x < 240 ; x++) {
111
- index = y * 240 + x;
112
111
angle = atan2 (y - 120 , x - 120 );
113
112
r = uint8_t (127.5 * (cos (angle) + 1 ));
114
113
g = uint8_t (127.5 * (sin (angle) + 1 ));
0 commit comments