update with neopixels
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <Adafruit_NeoPixel.h>
+
unsigned long baud = 115200;
+Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, 2, NEO_GRB + NEO_KHZ800);
+
+
void setup() {
Serial.begin(baud);
+ pixel.begin();
+ pixel.setPixelColor(0, 10, 10, 10); pixel.show();
+
+ while (!Serial);
+ pixel.setPixelColor(0, 50, 50, 50); pixel.show();
+ delay(100);
SerialNina.begin(baud);
pinMode(13, OUTPUT);
- pinMode(ESP32_GPIO0, OUTPUT);
- pinMode(ESP32_RESETN, OUTPUT);
+ pinMode(NINA_GPIO0, OUTPUT);
+ pinMode(NINA_RESETN, OUTPUT);
// manually put the ESP32 in upload mode
- digitalWrite(ESP32_GPIO0, LOW);
+ digitalWrite(NINA_GPIO0, LOW);
- digitalWrite(ESP32_RESETN, LOW);
+ digitalWrite(NINA_RESETN, LOW);
+ delay(100);
+ digitalWrite(NINA_RESETN, HIGH);
+ pixel.setPixelColor(0, 20, 20, 0); pixel.show();
delay(100);
- digitalWrite(ESP32_RESETN, HIGH);
-
}
void loop() {
- if (Serial.available()) {
- digitalWrite(13, HIGH);
+ while (Serial.available()) {
+ pixel.setPixelColor(0, 10, 0, 0); pixel.show();
SerialESP32.write(Serial.read());
- digitalWrite(13, LOW);
}
- if (SerialESP32.available()) {
- Serial.write(SerialESP32.read());
+ while (SerialNina.available()) {
+ pixel.setPixelColor(0, 0, 0, 10); pixel.show();
+ Serial.write(SerialNina.read());
}
}
