update rp2040 sdfat API

This commit is contained in:
Liz 2025-01-22 21:44:32 -05:00
parent ff5fff5e38
commit 332efcb952
3 changed files with 8 additions and 6 deletions

View file

@ -30,7 +30,7 @@
#define SD_CS_PIN 23
SdFat SD;
File32 myFile;
FsFile myFile;
SdSpiConfig config(SD_CS_PIN, DEDICATED_SPI, SD_SCK_MHZ(16), &SPI1);
void setup() {

View file

@ -14,6 +14,8 @@ Adafruit_NeoPixel STRIP_2(NUM_PIXELS, BLOCK_2, NEO_GRB + NEO_KHZ800);
void setup() {
STRIP_1.begin();
STRIP_2.begin();
STRIP_1.setBrightness(25);
STRIP_2.setBrightness(50);
}
uint16_t pixelHue_1 = 0;
@ -22,15 +24,15 @@ uint16_t pixelHue_2 = 256;
void loop() {
pixelHue_1 += 256;
for(int i=0; i<STRIP_1.numPixels(); i++) {
int pixelHue_1 = pixelHue_1 + (i * 65536L / STRIP_1.numPixels());
STRIP_1.setPixelColor(i, STRIP_1.gamma32(STRIP_1.ColorHSV(pixelHue_1)));
int hue_1 = pixelHue_1 + (i * 65536L / STRIP_1.numPixels());
STRIP_1.setPixelColor(i, STRIP_1.gamma32(STRIP_1.ColorHSV(hue_1)));
}
STRIP_1.show();
pixelHue_2 -= 256;
for(int i=0; i<STRIP_2.numPixels(); i++) {
int pixelHue_2 = pixelHue_2 + (i * 65536L / STRIP_2.numPixels());
STRIP_2.setPixelColor(i, STRIP_2.gamma32(STRIP_2.ColorHSV(pixelHue_2)));
for(int i=STRIP_2.numPixels(); i>-1; i--) {
int hue_2 = pixelHue_2 + (i * 65536L / STRIP_2.numPixels());
STRIP_2.setPixelColor(i, STRIP_2.gamma32(STRIP_2.ColorHSV(hue_2)));
}
STRIP_2.show();