OK. So I have a program, working, on a ESP32_WROOM-32 board. And now that it's nearly ready I want to port it to an ESP32-C3-mini for size. It uses very few pins, as you can see below.
#include <FastLED.h>
#define NUM_LEDS 60 // Numbr of LEDs
#define DATA_PIN 4 // Incoming Data from BT
#define LED_TYPE NEOPIXEL
#define COLOUR_ORDER GRB
#define BRIGHTNESS 60
#define VOLTS 5
#define MAX_AMPS 500
int LED_SPEED = 10; // LED Speed - varies with Faster/Slower
int SOUND_VOLUME;
char SOUND_PLAYING;
char LED_COLOUR = 'B'; // LED Colour - varies Red/Blue/Green/White
char RUNNING = 'N'; // Defines whether light strip/sounds/buzzes are currently running Y = Yes, B = Brake (finish cycle then stop), N = No
#include "BluetoothSerial.h"
#define LEDpin 2 // The pin to which the LED is connected
BluetoothSerial SerialBT;
char command;
CRGB leds[NUM_LEDS];
void setup()
{
{ Serial.begin(115200);
SerialBT.begin("LightBar"); // Bluetooth device name
pinMode(LEDpin, OUTPUT);
Serial.println("The device started, now you can pair it with Bluetooth!");
}
{
FastLED.addLeds<LED_TYPE, DATA_PIN>(leds, NUM_LEDS);
FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS, MAX_AMPS);
FastLED.setBrightness(BRIGHTNESS);
FastLED.clear();
FastLED.show();
}
}
void loop() {
if (SerialBT.hasClient()) {
digitalWrite(LEDpin, HIGH); // Turn the LED on when connected
} else {
digitalWrite(LEDpin, LOW); // Turn the LED off when not connected
}
// DATA RECEIVED DATA RECEIVED DATA RECEIVED DATA RECEIVED
if (SerialBT.available()) {
char receivedChar = SerialBT.read();
{
Serial.println(receivedChar);
}
if (receivedChar == 'T') {
RUNNING = 'Y';
Serial.println(RUNNING);
}
if (receivedChar == 'O') {
RUNNING = 'B';
}
if (receivedChar == 'B') {
LED_COLOUR = 'B';
}
if (receivedChar == 'R') {
LED_COLOUR = 'R';
}
if (receivedChar == 'G') {
LED_COLOUR = 'G';
}
if (receivedChar == 'W') {
LED_COLOUR = 'W';
}
if (receivedChar == 'X') {
LED_COLOUR = 'X';
}
if (receivedChar == 'C') {
SOUND_PLAYING = 'T'; // Play Tick Tock
}
if (receivedChar == 'L') {
SOUND_PLAYING = 'B'; // Play Bell
}
if (receivedChar == 'Z') {
SOUND_PLAYING = 'Z'; // Turn Off Sound
}
if (receivedChar == '+') {
Serial.println(LED_SPEED);
int LEDSPEED = LED_SPEED - 1;
LED_SPEED = LEDSPEED;
Serial.println("+");
Serial.println(LED_SPEED);
}
if (receivedChar == '-') {
Serial.println(LED_SPEED);
int LEDSPEED = LED_SPEED + 1;
Serial.println("-");
Serial.println(LED_SPEED);
LED_SPEED == LEDSPEED;
}
}
// CYCLE CYCLE CYCLE CYCLE CYCLE CYCLE CYCLE CYCLE
if (RUNNING == 'Y' || RUNNING == 'B') {
Serial.println("CYCLE");
Serial.println(RUNNING);
if (RUNNING == 'B') {
RUNNING = 'N';
}
Serial.println(RUNNING);
// START - BLUE - BLUE - BLUE - BLUE
if (LED_COLOUR == 'B') {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Blue; // Blue LED
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
Serial.println("Blue R"); // PRINT "Blue R"
for (int dot = NUM_LEDS - 1; dot >= 0; dot--) {
leds[dot] = CRGB::Blue;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
leds[1] = CRGB::Black;
delay(LED_SPEED);
}
SerialBT.write(1);
Serial.println("Flash 1");
Serial.println("Blue L"); // PRINT "Blue L"
}
// END - BLUE - BLUE - BLUE - BLUE
// START - WHITE - WHITE - WHITE - WHITE
if (LED_COLOUR == 'W') {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::White; // White LEDs
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
Serial.println("White R"); // PRINT "White R"
for (int dot = NUM_LEDS - 1; dot >= 0; dot--) {
leds[dot] = CRGB::White;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
SerialBT.write(1);
Serial.println("Flash 2");
Serial.println("White L"); // PRINT "White L"
}
// END - WHITE - WHITE - WHITE - WHITE
// START - RED - RED - RED - RED - RED
if (LED_COLOUR == 'R') {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Red; // Red LEDs
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
Serial.println("Red R"); // PRINT "Red R"
for (int dot = NUM_LEDS - 1; dot >= 0; dot--) {
leds[dot] = CRGB::Red;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
SerialBT.write(1);
Serial.println("Flash 3");
Serial.println("Red L"); // PRINT "Red L"
}
// END - RED - RED - RED - RED - RED
// START - GREEN - GREEN - GREEN - GREEN
if (LED_COLOUR == 'G') {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Green; // Green LEDs
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
Serial.println("Green R"); // PRINT "Green R"
for (int dot = NUM_LEDS - 1; dot >= 0; dot--) {
leds[dot] = CRGB::Green;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(LED_SPEED);
}
SerialBT.write(1);
Serial.println("Flash 4");
Serial.println("Green L"); // PRINT "Green L"
}
// END - GREEN - GREEN - GREEN - GREEN
// START - LBOff - LBOff - LBOff - LBOff
if (LED_COLOUR == 'X') {
for (int dot = 0; dot < NUM_LEDS; dot++) {
leds[dot] = CRGB::Black; // Green LEDs
FastLED.show();
// clear this led for the next time around the loop
}
Serial.println("LBOff"); //
}
// END - LBOff - LBOff - LBOff - LBOff
}
}
My issue is that when I try to re-compile for the C3 I get a tonne of error messages.
I'll put them here, but I suspect there's one generic issue I'm missing.
Help? I've had, (and needed a lot of help here, but I'm clearly missing something.....
In file included from c:\Users\cex\Documents\Arduino\libraries\FastLED\src/FastLED.h:75,
from C:\Users\cex\Documents\Arduino\LearnStripBigC3\LearnStripBigC3.ino:1:
c:\Users\cex\Documents\Arduino\libraries\FastLED\src/fastspi.h:157:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output
# pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:713: undefined reference to `esp_spp_disconnect'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `_stop_bt':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:714: undefined reference to `esp_spp_deinit'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:189: undefined reference to `esp_spp_write'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:153: undefined reference to `esp_bt_gap_set_pin'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:650: undefined reference to `esp_bt_gap_register_callback'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `_init_bt':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:658: undefined reference to `esp_spp_register_callback'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:664: undefined reference to `esp_spp_init'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:686: undefined reference to `esp_bt_gap_set_security_param'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:691: undefined reference to `esp_bt_gap_set_cod'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.LVL474':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:265: undefined reference to `esp_bt_gap_set_scan_mode'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `esp_spp_cb':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:271: undefined reference to `esp_spp_start_srv'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:283: undefined reference to `esp_spp_disconnect'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:364: undefined reference to `esp_spp_connect'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:391: undefined reference to `esp_spp_disconnect'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:126: undefined reference to `esp_bt_gap_resolve_eir_data'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `get_name_from_eir':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:130: undefined reference to `esp_bt_gap_resolve_eir_data'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:456: undefined reference to `esp_bt_gap_cancel_discovery'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Temp\arduino\sketches\68E0B262AF9CB632D1443F83FF0C871A\libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `esp_bt_gap_cb':
C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:458: undefined reference to `esp_spp_start_discovery'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:522: undefined reference to `esp_bt_gap_pin_reply'
c:/users/cex/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial\src/BluetoothSerial.cpp:538: undefined reference to `esp_bt_gap_ssp_confirm_reply'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "BluetoothSerial.h"
Used: C:\Users\cex\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\BluetoothSerial
Not used: C:\Users\cex\Documents\Arduino\libraries\BluetoothSerial
exit status 1
Compilation error: exit status 1