forked from adafruit/circuitpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrgb_led_colors.h
More file actions
37 lines (29 loc) · 1.08 KB
/
rgb_led_colors.h
File metadata and controls
37 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2017-2021 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
#define COLOR(r, g, b) (((r) << 16) | ((g) << 8) | (b))
// For brightness == 255 (full). This will be adjusted downward for various different RGB indicators,
// which vary in brightness.
#define INTENSITY (0x30)
#define BLACK COLOR(0, 0, 0)
#define GREEN COLOR(0, INTENSITY, 0)
#define BLUE COLOR(0, 0, INTENSITY)
#define CYAN COLOR(0, INTENSITY, INTENSITY)
#define RED COLOR(INTENSITY, 0, 0)
#define ORANGE COLOR(INTENSITY, INTENSITY * 2 / 3, 0)
#define YELLOW COLOR(INTENSITY, INTENSITY, 0)
#define PURPLE COLOR(INTENSITY, 0, INTENSITY)
#define WHITE COLOR(INTENSITY, INTENSITY, INTENSITY)
#define ALL_DONE GREEN
#define EXCEPTION RED
#define SAFE_MODE YELLOW
#define REPL_RUNNING WHITE
#define ALL_DONE_BLINKS 1
#define EXCEPTION_BLINKS 2
#define SAFE_MODE_BLINKS 3
#define OFF_ON_RATIO 3
#define LED_SLEEP_TIME_MS 5000u
#define BLINK_TIME_MS 100u