Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FOSS-AG-Display-Badge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FOSS-AG
PCBs
FOSS-AG-Display-Badge
Commits
02dd0e6e
Commit
02dd0e6e
authored
6 months ago
by
Luca
Browse files
Options
Downloads
Patches
Plain Diff
Define flag count in variable
parent
79117fae
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
badge.ino
+12
-12
12 additions, 12 deletions
badge.ino
with
12 additions
and
12 deletions
badge.ino
+
12
−
12
View file @
02dd0e6e
...
@@ -19,7 +19,15 @@ Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RS
...
@@ -19,7 +19,15 @@ Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RS
Adafruit_NeoPixel
pixels
(
NUM_LEDS
,
LED_PIN
,
NEO_GRB
+
NEO_KHZ800
);
Adafruit_NeoPixel
pixels
(
NUM_LEDS
,
LED_PIN
,
NEO_GRB
+
NEO_KHZ800
);
uint32_t
ledColors
[
6
][
NUM_LEDS
]
=
{
#define COUNT_FLAGS 6
#define BI 0
#define ENBY 1
#define TRANS 2
#define PAN 3
#define PRIDE 4
#define ACE 5
uint32_t
ledColors
[
COUNT_FLAGS
][
NUM_LEDS
]
=
{
{
0xD60270
,
0xD60270
,
0xD60270
,
0xD60270
,
0xD60270
,
0x9B4F96
,
0x9B4F96
,
0x0038A8
,
0x0038A8
,
0x0038A8
,
0x0038A8
,
0x0038A8
},
{
0xD60270
,
0xD60270
,
0xD60270
,
0xD60270
,
0xD60270
,
0x9B4F96
,
0x9B4F96
,
0x0038A8
,
0x0038A8
,
0x0038A8
,
0x0038A8
,
0x0038A8
},
{
0xFCF434
,
0xFCF434
,
0xFCF434
,
0xFFFFFF
,
0xFFFFFF
,
0xFFFFFF
,
0x9C59D1
,
0x9C59D1
,
0x9C59D1
,
0x2C2C2C
,
0x2C2C2C
,
0x2C2C2C
},
{
0xFCF434
,
0xFCF434
,
0xFCF434
,
0xFFFFFF
,
0xFFFFFF
,
0xFFFFFF
,
0x9C59D1
,
0x9C59D1
,
0x9C59D1
,
0x2C2C2C
,
0x2C2C2C
,
0x2C2C2C
},
{
0x5BCEFA
,
0x5BCEFA
,
0x5BCEFA
,
0xF5A9B8
,
0xF5A9B8
,
0xFFFFFF
,
0xFFFFFF
,
0xF5A9B8
,
0xF5A9B8
,
0x5BCEFA
,
0x5BCEFA
,
0x5BCEFA
},
{
0x5BCEFA
,
0x5BCEFA
,
0x5BCEFA
,
0xF5A9B8
,
0xF5A9B8
,
0xFFFFFF
,
0xFFFFFF
,
0xF5A9B8
,
0xF5A9B8
,
0x5BCEFA
,
0x5BCEFA
,
0x5BCEFA
},
...
@@ -28,19 +36,11 @@ uint32_t ledColors[6][NUM_LEDS] = {
...
@@ -28,19 +36,11 @@ uint32_t ledColors[6][NUM_LEDS] = {
{
0x000000
,
0x000000
,
0x000000
,
0xA3A3A3
,
0xA3A3A3
,
0xA3A3A3
,
0xFFFFFF
,
0xFFFFFF
,
0xFFFFFF
,
0x800080
,
0x800080
,
0x800080
}
{
0x000000
,
0x000000
,
0x000000
,
0xA3A3A3
,
0xA3A3A3
,
0xA3A3A3
,
0xFFFFFF
,
0xFFFFFF
,
0xFFFFFF
,
0x800080
,
0x800080
,
0x800080
}
};
};
#define BI 0
#define ENBY 1
#define TRANS 2
#define PAN 3
#define PRIDE 4
#define ACE 5
int
current_flag
=
0
;
int
current_flag
=
0
;
void
setup
(
void
)
{
void
setup
(
void
)
{
Serial
.
begin
(
9600
);
Serial
.
begin
(
9600
);
Serial
.
print
(
F
(
"Welcome to FOSS-AG-
Display-Badg
e!"
));
Serial
.
print
(
F
(
"Welcome to FOSS-AG-
Prid
e!"
));
tft
.
init
(
240
,
320
);
// Init ST7789 320x240
tft
.
init
(
240
,
320
);
// Init ST7789 320x240
//tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
//tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
...
@@ -98,7 +98,7 @@ void loop() {
...
@@ -98,7 +98,7 @@ void loop() {
}
}
current_flag
++
;
current_flag
++
;
if
(
current_flag
==
6
)
{
if
(
current_flag
==
COUNT_FLAGS
)
{
current_flag
=
0
;
current_flag
=
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment