Rev B changes

This commit is contained in:
Andriy Malyshenko
2023-01-19 15:58:19 +01:00
parent 146e91ba83
commit 7e3b25ba6b
6 changed files with 23960 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
#define PIN_LED PIN_PB4 // 5
#define PIN_RGB PIN_PA7
#define PIN_BTN PIN_PA0
uint8_t seq = 0;
@@ -11,6 +12,7 @@ Adafruit_NeoPixel pixels(1, PIN_RGB, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_BTN, INPUT);
delay(1000);
Serial.begin(115200);
@@ -19,11 +21,19 @@ void setup() {
pixels.begin();
}
uint8_t btn_state = HIGH;
void loop() {
seq++;
Serial.print('.');
if (btn_state != digitalRead(PIN_BTN)) {
btn_state = !btn_state;
Serial.print("Button state is ");
Serial.println(btn_state);
}
digitalWrite(PIN_LED, seq % 2);
pixels.clear();
@@ -31,5 +41,5 @@ void loop() {
pixels.setPixelColor(0, pixels.Color((0xff - seq) % 0xff, seq % 0xff, seq % 0x7f + (0xff - seq) % 0x7f));
pixels.show();
delay(250);
delay(500);
}