renaming boards

This commit is contained in:
Kyle Isom 2020-12-26 11:48:07 -08:00
parent 99e9741837
commit 3997683657
3 changed files with 33 additions and 8 deletions

View File

@ -1,4 +1,4 @@
BOARD := adafruit_feather_m4
BOARD := m4
FIRMWARE := .pioenvs/$(BOARD)/firmware.bin
SOURCES := \
src/main.cc

View File

@ -27,8 +27,8 @@ lib_deps =
SPI
Wire
[env:adafruit_feather_m4]
[env:m4]
board = adafruit_feather_m4
[env:adafruit_feather_m0]
[env:m0]
board = adafruit_feather_m0

View File

@ -2,6 +2,8 @@
Adafruit_NeoPixel pixels(1, 11, NEO_GRB + NEO_KHZ800);
auto cOff = pixels.Color(0, 0, 0);
auto cGreen = pixels.Color(0, 255, 0);
auto cRed = pixels.Color(255, 0, 0);
auto cBlue = pixels.Color(0, 0, 255);
@ -16,12 +18,9 @@ setup()
}
void
loop()
bool
blink(bool on)
{
static bool on = false;
Serial.println("blink");
if (on) {
for (int i = 10; i < 255; i++) {
auto c = pixels.Color(0, (uint8_t)i, 0);
@ -39,4 +38,30 @@ loop()
}
on = true;
}
return on;
}
void
pixelOn(uint32_t c)
{
pixels.setPixelColor(0, c);
pixels.show();
}
void
pixelOff()
{
pixels.setPixelColor(0, cOff);
pixels.show();
}
void
loop()
{
static bool on = false;
on = blink(on);
}