Unverified Commit 99e68a05 authored by Rodrigo Garcia's avatar Rodrigo Garcia Committed by GitHub

Change "neopixel" references to use RGB LED naming (#10225)

* fix(rgbled): fixes core rgbledWrite()

* fix(rgbled): fixes examples - rgbledWrite()

* fix(rgbled): fixes variants commetaries - rgbledWrite()

* fix(rgbled): examples and doc - use RGB_LED naming

* fix(rgbled): variants - use RGB_LED naming

* fix(rgbled): other places for RGB LED naming

* fix(typo): cores - rgbLed instead of rgbled

* fix(typo): examples - rgbLed instead of rgbled

* fix(typo): variants commentaties - rgbLed instead of rgbled

* fix(rgbled): bad file name

* fix(typo): typo and commentaries
Co-authored-by: default avatarLucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>

* fix(rgbled): deprecating neopixelWrite()

* fix(rgbled): use RGB LED naming

* fix(rgbled): document formatting

* fix(rgbled): neopixelWrite() is now deprecated

* fix(rgbled): removed attribute in wrong place

* just a git push test

* restart git bash test

* ci(pre-commit): Apply automatic fixes

* removed wrong test file

* fix(rgbled): new Arduino style depreacted attribute

---------
Co-authored-by: default avatarLucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Co-authored-by: default avatarpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
parent 0539ebf3
......@@ -166,7 +166,7 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val) {
//use RMT to set all channels on/off
RGB_BUILTIN_storage = val;
const uint8_t comm_val = val != 0 ? RGB_BRIGHTNESS : 0;
neopixelWrite(RGB_BUILTIN, comm_val, comm_val, comm_val);
rgbLedWrite(RGB_BUILTIN, comm_val, comm_val, comm_val);
return;
}
#endif // RGB_BUILTIN
......
......@@ -16,6 +16,12 @@
#include "esp32-hal-rgb-led.h"
// Backward compatibility - Deprecated. It will be removed in future releases.
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val) {
log_w("neopixelWrite() is deprecated. Use rgbLedWrite().");
rgbLedWrite(pin, red_val, green_val, blue_val);
}
void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val) {
rgbLedWriteOrdered(pin, RGB_BUILTIN_LED_COLOR_ORDER, red_val, green_val, blue_val);
}
......
......@@ -29,8 +29,9 @@ void rgbLedWriteOrdered(uint8_t pin, rgb_led_color_order_t order, uint8_t red_va
// Will use RGB_BUILTIN_LED_COLOR_ORDER
void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val);
// Backward compatibility
#define neopixelWrite(p, r, g, b) rgbLedWrite(p, r, g, b)
// Backward compatibility - Deprecated. It will be removed in future releases.
[[deprecated("Use rgbLedWrite() instead.")]]
void neopixelWrite(uint8_t p, uint8_t r, uint8_t g, uint8_t b);
#ifdef __cplusplus
}
......
......@@ -77,7 +77,7 @@ int8_t gpioNumberToDigitalPin(int8_t gpioNumber);
#define pinMatrixOutDetach(pin, invertOut, invertEnable) pinMatrixOutDetach(digitalPinToGPIONumber(pin), invertOut, invertEnable)
// cores/esp32/esp32-hal-rgb-led.h
#define neopixelWrite(pin, red_val, green_val, blue_val) neopixelWrite(digitalPinToGPIONumber(pin), red_val, green_val, blue_val)
#define rgbLedWrite(pin, red_val, green_val, blue_val) rgbLedWrite(digitalPinToGPIONumber(pin), red_val, green_val, blue_val)
// cores/esp32/esp32-hal-rmt.h
#define rmtInit(pin, channel_direction, memsize, frequency_Hz) rmtInit(digitalPinToGPIONumber(pin), channel_direction, memsize, frequency_Hz)
......
......@@ -14,10 +14,10 @@ Example
To get started with RMT, you can try:
RMT Write Neo Pixel
*******************
RMT Write RGB LED
*****************
.. literalinclude:: ../../../libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino
.. literalinclude:: ../../../libraries/ESP32/examples/RMT/RMTWrite_RGB_LED/RMTWrite_RGB_LED.ino
:language: arduino
......
......@@ -6,7 +6,7 @@
Calling digitalWrite(RGB_BUILTIN, HIGH) will use hidden RGB driver.
RGBLedWrite demonstrates control of each channel:
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
WARNING: After using digitalWrite to drive RGB LED it will be impossible to drive the same pin
with normal HIGH/LOW level
......@@ -27,13 +27,13 @@ void loop() {
digitalWrite(RGB_BUILTIN, LOW); // Turn the RGB LED off
delay(1000);
neopixelWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red
rgbLedWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red
delay(1000);
neopixelWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
rgbLedWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
delay(1000);
neopixelWrite(RGB_BUILTIN, 0, 0, RGB_BRIGHTNESS); // Blue
rgbLedWrite(RGB_BUILTIN, 0, 0, RGB_BRIGHTNESS); // Blue
delay(1000);
neopixelWrite(RGB_BUILTIN, 0, 0, 0); // Off / black
rgbLedWrite(RGB_BUILTIN, 0, 0, 0); // Off / black
delay(1000);
#endif
}
......@@ -17,7 +17,7 @@
#else
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver
// neoPixelWrite() is a function that writes to the RGB LED and it won't be available here
// rgbLedWrite() is a function that writes to the RGB LED and it won't be available here
#include "driver/rmt.h"
bool installed = false;
......
// Copyright 2023 Espressif Systems (Shanghai) PTE LTD
// Copyright 2024 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
......@@ -20,17 +20,17 @@
*/
// The effect seen in (Espressif devkits) ESP32C6, ESP32H2, ESP32C3, ESP32S2 and ESP32S3 is like a Blink of RGB LED
#ifdef PIN_NEOPIXEL
#define BUILTIN_RGBLED_PIN PIN_NEOPIXEL
#ifdef PIN_LED_RGB
#define BUILTIN_RGBLED_PIN PIN_LED_RGB
#else
#define BUILTIN_RGBLED_PIN 21 // ESP32 has no builtin RGB LED (PIN_NEOPIXEL)
#define BUILTIN_RGBLED_PIN 21 // ESP32 has no builtin RGB LED (PIN_LED_RGB)
#endif
#define NR_OF_LEDS 8 * 4
#define NR_OF_ALL_BITS 24 * NR_OF_LEDS
//
// Note: This example uses Neopixel LED board, 32 LEDs chained one
// Note: This example uses a board with 32 WS2812b LEDs chained one
// after another, each RGB LED has its 24 bit value
// for color configuration (8b for each color)
//
......
......@@ -17,7 +17,7 @@
* that RMT works on any CPU/APB Frequency.
*
* It uses an ESP32 Arduino builtin RGB NeoLED function based on RMT:
* void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
* void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
*
* The output is a visual WS2812 RGB LED color change routine using each time a
* different CPU Frequency, just to illustrate how it works. Serial output indicates
......@@ -26,10 +26,10 @@
// Default DevKit RGB LED GPIOs:
// The effect seen in (Espressif devkits) ESP32C6, ESP32H2, ESP32C3, ESP32S2 and ESP32S3 is like a Blink of RGB LED
#ifdef PIN_NEOPIXEL
#define MY_LED_GPIO PIN_NEOPIXEL
#ifdef PIN_RGB_LED
#define MY_LED_GPIO PIN_RGB_LED
#else
#define MY_LED_GPIO 21 // ESP32 has no builtin RGB LED (PIN_NEOPIXEL)
#define MY_LED_GPIO 21 // ESP32 has no builtin RGB LED (PIN_RGB_LED)
#endif
// Set the correct GPIO to any necessary by changing RGB_LED_GPIO value
......@@ -65,22 +65,22 @@ void loop() {
Serial.updateBaudRate(115200);
Serial.printf("\n--changed CPU Frequency to %lu MHz\n", getCpuFrequencyMhz());
neopixelWrite(RGB_LED_GPIO, BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); // White
rgbLedWrite(RGB_LED_GPIO, BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); // White
Serial.println("White");
delay(1000);
neopixelWrite(RGB_LED_GPIO, 0, 0, 0); // Off
rgbLedWrite(RGB_LED_GPIO, 0, 0, 0); // Off
Serial.println("Off");
delay(1000);
neopixelWrite(RGB_LED_GPIO, BRIGHTNESS, 0, 0); // Red
rgbLedWrite(RGB_LED_GPIO, BRIGHTNESS, 0, 0); // Red
Serial.println("Red");
delay(1000);
neopixelWrite(RGB_LED_GPIO, 0, BRIGHTNESS, 0); // Green
rgbLedWrite(RGB_LED_GPIO, 0, BRIGHTNESS, 0); // Green
Serial.println("Green");
delay(1000);
neopixelWrite(RGB_LED_GPIO, 0, 0, BRIGHTNESS); // Blue
rgbLedWrite(RGB_LED_GPIO, 0, 0, BRIGHTNESS); // Blue
Serial.println("Blue");
delay(1000);
neopixelWrite(RGB_LED_GPIO, 0, 0, 0); // Off
rgbLedWrite(RGB_LED_GPIO, 0, 0, 0); // Off
Serial.println("Off");
delay(1000);
}
......@@ -20,7 +20,7 @@ Currently, this example supports the following targets.
### Configure the Project
Set the LED GPIO by changing the `LED_PIN` definition. By default, the LED_PIN is `RGB_BUILTIN`.
By default, the `neoPixelWrite` function is used to control the LED. You can change it to digitalWrite to control a simple LED.
By default, the `rgbLedWrite` function is used to control the LED. You can change it to digitalWrite to control a simple LED.
#### Using Arduino IDE
......
......@@ -155,7 +155,7 @@ static esp_err_t zb_attribute_handler(const esp_zb_zcl_set_attr_value_message_t
if (message->attribute.id == ESP_ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_BOOL) {
light_state = message->attribute.data.value ? *(bool *)message->attribute.data.value : light_state;
log_i("Light sets to %s", light_state ? "On" : "Off");
neopixelWrite(LED_PIN, 255 * light_state, 255 * light_state, 255 * light_state); // Toggle light
rgbLedWrite(LED_PIN, 255 * light_state, 255 * light_state, 255 * light_state); // Toggle light
}
}
}
......@@ -172,7 +172,7 @@ void setup() {
ESP_ERROR_CHECK(esp_zb_platform_config(&config));
// Init RMT and leave light OFF
neopixelWrite(LED_PIN, 0, 0, 0);
rgbLedWrite(LED_PIN, 0, 0, 0);
// Start Zigbee task
xTaskCreate(esp_zb_task, "Zigbee_main", 4096, NULL, 5, NULL);
......
......@@ -55,7 +55,7 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
}
if (i != nCmds1) {
log_e("Sorry, OpenThread Network setup failed!");
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.println("OpenThread started.\r\nWaiting for activating correct Device Role.");
......@@ -69,7 +69,7 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
Serial.println();
if (!tries) {
log_e("Sorry, Device Role failed by timeout! Current Role: %s.", otGetStringDeviceRole());
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.printf("Device is %s.\r\n", otGetStringDeviceRole());
......@@ -80,12 +80,12 @@ bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoap
}
if (i != nCmds2) {
log_e("Sorry, OpenThread CoAP setup failed!");
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.println("OpenThread setup done. Node is ready.");
// all fine! LED goes Green
neopixelWrite(RGB_BUILTIN, 0, 64, 8); // GREEN ... Lamp is ready!
rgbLedWrite(RGB_BUILTIN, 0, 64, 8); // GREEN ... Lamp is ready!
return true;
}
......@@ -118,16 +118,16 @@ void otCOAPListen() {
log_i("CoAP PUT [%s]\r\n", payload == '0' ? "OFF" : "ON");
if (payload == '0') {
for (int16_t c = 248; c > 16; c -= 8) {
neopixelWrite(RGB_BUILTIN, c, c, c); // ramp down
rgbLedWrite(RGB_BUILTIN, c, c, c); // ramp down
delay(5);
}
neopixelWrite(RGB_BUILTIN, 0, 0, 0); // Lamp Off
rgbLedWrite(RGB_BUILTIN, 0, 0, 0); // Lamp Off
} else {
for (int16_t c = 16; c < 248; c += 8) {
neopixelWrite(RGB_BUILTIN, c, c, c); // ramp up
rgbLedWrite(RGB_BUILTIN, c, c, c); // ramp up
delay(5);
}
neopixelWrite(RGB_BUILTIN, 255, 255, 255); // Lamp On
rgbLedWrite(RGB_BUILTIN, 255, 255, 255); // Lamp On
}
}
}
......@@ -136,7 +136,7 @@ void otCOAPListen() {
void setup() {
Serial.begin(115200);
// LED starts RED, indicating not connected to Thread network.
neopixelWrite(RGB_BUILTIN, 64, 0, 0);
rgbLedWrite(RGB_BUILTIN, 64, 0, 0);
OThreadCLI.begin(false); // No AutoStart is necessary
OThreadCLI.setTimeout(250); // waits 250ms for the OpenThread CLI response
setupNode();
......
......@@ -49,7 +49,7 @@ bool otDeviceSetup(
}
if (i != nCmds1) {
log_e("Sorry, OpenThread Network setup failed!");
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.println("OpenThread started.\r\nWaiting for activating correct Device Role.");
......@@ -63,7 +63,7 @@ bool otDeviceSetup(
Serial.println();
if (!tries) {
log_e("Sorry, Device Role failed by timeout! Current Role: %s.", otGetStringDeviceRole());
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.printf("Device is %s.\r\n", otGetStringDeviceRole());
......@@ -74,12 +74,12 @@ bool otDeviceSetup(
}
if (i != nCmds2) {
log_e("Sorry, OpenThread CoAP setup failed!");
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... failed!
return false;
}
Serial.println("OpenThread setup done. Node is ready.");
// all fine! LED goes and stays Blue
neopixelWrite(RGB_BUILTIN, 0, 0, 64); // BLUE ... Swtich is ready!
rgbLedWrite(RGB_BUILTIN, 0, 0, 64); // BLUE ... Swtich is ready!
return true;
}
......@@ -149,7 +149,7 @@ void checkUserButton() {
lastLampState = !lastLampState;
if (!otCoapPUT(lastLampState)) { // failed: Lamp Node is not responding due to be off or unreachable
// timeout from the CoAP PUT message... restart the node.
neopixelWrite(RGB_BUILTIN, 255, 0, 0); // RED ... something failed!
rgbLedWrite(RGB_BUILTIN, 255, 0, 0); // RED ... something failed!
Serial.println("Reseting the Node as Switch... wait.");
// start over...
setupNode();
......@@ -161,7 +161,7 @@ void checkUserButton() {
void setup() {
Serial.begin(115200);
// LED starts RED, indicating not connected to Thread network.
neopixelWrite(RGB_BUILTIN, 64, 0, 0);
rgbLedWrite(RGB_BUILTIN, 64, 0, 0);
OThreadCLI.begin(false); // No AutoStart is necessary
OThreadCLI.setTimeout(250); // waits 250ms for the OpenThread CLI response
setupNode();
......
......@@ -65,12 +65,12 @@ static const uint8_t LDO2 = 34;
static const uint8_t RGB_DATA = 40;
static const uint8_t RGB_PWR = 34;
#define PIN_NEOPIXEL RGB_DATA
#define PIN_RGB_LED RGB_DATA
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -73,12 +73,12 @@ static const uint8_t LDO2 = 34;
static const uint8_t RGB_DATA = 40;
static const uint8_t RGB_PWR = 34;
#define PIN_NEOPIXEL RGB_DATA
#define PIN_RGB_LED RGB_DATA
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -62,12 +62,12 @@ static const uint8_t VBAT_VOLTAGE = 1;
static const uint8_t RGB_DATA = 48;
static const uint8_t RGB_PWR = 34;
#define PIN_NEOPIXEL RGB_DATA
#define PIN_RGB_LED RGB_DATA
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -18,7 +18,7 @@ static const uint8_t NEOPIXEL_PIN = 1;
static const uint8_t LED_BUILTIN = PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -46,7 +46,7 @@ static const uint8_t LED_BUILTIN = 13;
// Neopixel
#define PIN_NEOPIXEL 0
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -9,7 +9,7 @@
static const uint8_t LED_BUILTIN = 15;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -11,7 +11,7 @@ static const uint8_t LED_BUILTIN = 13;
// Neopixel
static const uint8_t PIN_NEOPIXEL = 0;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
// Neopixel
#define PIN_NEOPIXEL 1 // D1
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,7 +16,7 @@
#define PIN_NEOPIXEL 4
#define NEOPIXEL_PIN 4
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -15,7 +15,7 @@
// Neopixel
#define PIN_NEOPIXEL 45
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -15,7 +15,7 @@
// Neopixel
#define PIN_NEOPIXEL 46
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -11,7 +11,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -13,7 +13,7 @@ static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -15,7 +15,7 @@
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -18,7 +18,7 @@
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -18,7 +18,7 @@
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -10,12 +10,12 @@
#define USB_PRODUCT "ATMZ-ESP32S2"
#define USB_SERIAL ""
static const uint8_t NEOPIXEL = 40;
static const uint8_t RGB_LED_PIN = 40;
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = (NEOPIXEL + SOC_GPIO_PIN_COUNT);
static const uint8_t LED_BUILTIN = (RGB_LED_PIN + SOC_GPIO_PIN_COUNT);
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -9,13 +9,13 @@ static const uint8_t BUZZER = 25;
static const uint8_t BUTTON_A = 35;
static const uint8_t BUTTON_B = 27;
// NeoPixel Matrix 5 x 5
// RGB LED Matrix 5 x 5
static const uint8_t RGB_LED = 4;
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
#define LED_BUILTIN (RGB_LED + SOC_GPIO_PIN_COUNT) // Just a single LED in the Matrix
#define BUILTIN_LED LED_BUILTIN // backward compatibility
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
static const uint8_t LIGHT_SENSOR1 = 36;
......
......@@ -13,12 +13,12 @@
// Some boards have too low voltage on this pin (board design bug)
// Use different pin with 3V and connect with 48
// and change this setup for the chosen pin (for example 38)
#define PIN_NEOPIXEL 48
#define PIN_RGB_LED 48
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 25
......
......@@ -13,12 +13,12 @@
#define LED_BUILTIN 46
#define BUILTIN_LED LED_BUILTIN // backward compatibility
// Neopixel
#define PIN_NEOPIXEL 47
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
// RGB LED
#define PIN_RGB_LED 47
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_RGB_LED + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
#define NEOPIXEL_NUM 1 // number of neopixels
#define RGBLED_NUM 1 // number of RGB LEDs
static const uint8_t KEY_BUILTIN = 0;
......
......@@ -19,7 +19,7 @@ static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT + 46; // RGB LED.
#define LED LED_BUILTIN
#define RGB RGB_BUILTIN
#define NEOPIXEL RGB_BUILTIN
#define RGB_LED_PIN RGB_BUILTIN
#define RGB_BRIGHTNESS 65
#define VP_EN 11 // V Peripheral Enable.
......
......@@ -14,15 +14,15 @@
#define LED_BUILTIN 13
#define BUILTIN_LED LED_BUILTIN // backward compatibility
// Neopixel
#define PIN_NEOPIXEL 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite() and digitalWrite() for blinking
#define RGB_BUILTIN (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT)
// RGB LED
#define PIN_RGB_LED 33
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWritee() for blinking
#define RGB_BUILTIN (PIN_RGB_LED + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
#define NEOPIXEL_NUM 1 // number of neopixels
#define NEOPIXEL_POWER 21 // power pin
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
#define RGBLED_NUM 1 // number of RGB LEDs
#define RGBLED_POWER 21 // power pin
#define RGBLED_POWER_ON HIGH // power pin state when on
#define PIN_SERVO 2 // servo pin
#define PIN_ISOLATED_INPUT 40 // optocoupled input
......
......@@ -30,8 +30,8 @@ extern "C" {
// Initialize variant/board, called before setup()
void initVariant(void) {
// This board has a power control pin, and we must set it to output and high
// in order to enable the NeoPixels.
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, HIGH);
// in order to enable the RGB LEDs.
pinMode(RGBLED_POWER, OUTPUT);
digitalWrite(RGBLED_POWER, HIGH);
}
}
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 8
#define PIN_RGB_LED 8
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 8
#define PIN_RGB_LED 8
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 8
#define PIN_RGB_LED 8
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 8
#define PIN_RGB_LED 8
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -4,8 +4,8 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 18
#define RGB_BUILTIN PIN_NEOPIXEL
#define PIN_RGB_LED 18
#define RGB_BUILTIN PIN_RGB_LED
#define RGB_BRIGHTNESS 64
static const uint8_t BUT_BUILTIN = 0;
......
......@@ -4,8 +4,8 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 18
#define RGB_BUILTIN PIN_NEOPIXEL
#define PIN_RGB_LED 18
#define RGB_BUILTIN PIN_RGB_LED
#define RGB_BRIGHTNESS 64
static const uint8_t BUT_BUILTIN = 0;
......
......@@ -5,14 +5,14 @@
#include "soc/soc_caps.h"
// GPIO pin for Saola-1 & DevKitM-1 = 18
#define PIN_NEOPIXEL 18
#define PIN_RGB_LED 18
// GPIO pin for Kaluga = 45
//#define PIN_NEOPIXEL 45
//#define PIN_RGB_LED 45
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -10,12 +10,12 @@
// Some boards have too low voltage on this pin (board design bug)
// Use different pin with 3V and connect with 48
// and change this setup for the chosen pin (for example 38)
#define PIN_NEOPIXEL 48
#define PIN_RGB_LED 48
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -8,7 +8,7 @@ static const uint8_t LED_BUILTIN = 13;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT + 2;
#define RGB_BUILTIN RGB_BUILTIN // necessary to make digitalWrite/digitalMode find it
#define RGB_BRIGHTNESS 64
......
......@@ -11,12 +11,12 @@
#define USB_SERIAL "0"
#define USB_WEBUSB_ENABLED false
static const uint8_t PIN_NEOPIXEL = 18;
static const uint8_t PIN_RGB_LED = 18;
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT);
static const uint8_t LED_BUILTIN = (PIN_RGB_LED + SOC_GPIO_PIN_COUNT);
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -18,12 +18,12 @@
#define USB_FW_MSC_VOLUME_NAME "S2-Firmware" //max 11 chars
#define USB_FW_MSC_SERIAL_NUMBER 0x00000000
static const uint8_t PIN_NEOPIXEL = 18;
static const uint8_t PIN_RGB_LED = 18;
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT);
static const uint8_t LED_BUILTIN = (PIN_RGB_LED + SOC_GPIO_PIN_COUNT);
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -15,12 +15,12 @@
#define LTE_WAKE 27 // GPIO27 - Sequans modem wake-up interrupt
#define LTE_BAUD 921600
// Neopixel
#define PIN_NEOPIXEL 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT;
// RGB LED
#define PIN_RGB_LED 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_RGB_LED + SOC_GPIO_PIN_COUNT;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -15,12 +15,12 @@
#define LORA_IO1 LORA_IRQ // tied by diode to IO0
#define LORA_IO2 LORA_IRQ // tied by diode to IO0
// Neopixel
#define PIN_NEOPIXEL 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT;
// RGB LED
#define PIN_RGB_LED 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_RGB_LED + SOC_GPIO_PIN_COUNT;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -15,12 +15,12 @@
#define LORA_IO2 LORA_IRQ // tied by diode to IO0
#define LORA_RST NOT_A_PIN
// Neopixel
#define PIN_NEOPIXEL 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT;
// RGB LED
#define PIN_RGB_LED 0 // ->2812 RGB !!!
static const uint8_t LED_BUILTIN = PIN_RGB_LED + SOC_GPIO_PIN_COUNT;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -66,7 +66,7 @@ static const uint8_t LED_BUILTIN = 21;
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
static const uint8_t PIXEL_BUILTIN = 33;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (PIXEL_BUILTIN + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -16,9 +16,9 @@
#define USB_FW_MSC_VOLUME_NAME "senseBox" // max 11 chars
#define USB_FW_MSC_SERIAL_NUMBER 0x00000000
#define PIN_NEOPIXEL 1 // NeoPixel LED
#define NEOPIXEL_PIN 1 // NeoPixel LED
#define NEOPIXEL_NUM 1 // number of neopixels
#define PIN_RGB_LED 1 // RGB LED
#define RGBLED_PIN 1 // RGB LED
#define RGBLED_NUM 1 // number of RGB LEDs
// Default I2C QWIIC-Ports
static const uint8_t SDA = 39;
......
......@@ -34,8 +34,8 @@ void initVariant(void) {
digitalWrite(IO_ENABLE, LOW);
//reset RGB
pinMode(PIN_NEOPIXEL, OUTPUT);
digitalWrite(PIN_NEOPIXEL, LOW);
pinMode(PIN_RGB_LED, OUTPUT);
digitalWrite(PIN_RGB_LED, LOW);
//enable XBEE by default
pinMode(PIN_XB1_ENABLE, OUTPUT);
......
......@@ -8,8 +8,8 @@ static const uint8_t LED_BUILTIN = 18;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
#define NEO_PIXEL 2 //WS2812 LED
static const uint8_t RGB_BUILTIN = (SOC_GPIO_PIN_COUNT + NEO_PIXEL);
#define RGB_LED_PIN 2 //WS2812 LED
static const uint8_t RGB_BUILTIN = (SOC_GPIO_PIN_COUNT + RGB_LED_PIN);
#define RGB_BUILTIN RGB_BUILTIN // necessary to make digitalWrite/digitalMode find it
#define RGB_BRIGHTNESS 64
......
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 23
#define PIN_RGB_LED 23
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -4,12 +4,12 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#define PIN_NEOPIXEL 8
#define PIN_RGB_LED 8
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_NEOPIXEL;
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
......@@ -11,7 +11,7 @@
#define USB_SERIAL ""
static const uint8_t RGB_DATA = 38;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -67,7 +67,7 @@ static const uint8_t I2S_AMP_WS = 1;
static const uint8_t RTC_INT = 7;
static const uint8_t RGB_DATA = 18;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -54,7 +54,7 @@ static const uint8_t NEOPIXEL_MATRIX_DATA = 21;
static const uint8_t NEOPIXEL_MATRIX_PWR = 4;
static const uint8_t NEOPIXEL_DATA = 40;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (NEOPIXEL_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -57,7 +57,7 @@ static const uint8_t VBUS_SENSE = 34;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t RGB_DATA = 40;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -57,7 +57,7 @@ static const uint8_t VBUS_SENSE = 15;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t RGB_DATA = 40;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
......
......@@ -44,7 +44,7 @@ static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t RGB_DATA = 41;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -55,7 +55,7 @@ static const uint8_t VBAT_SENSE = 10;
static const uint8_t VBUS_SENSE = 33;
static const uint8_t RGB_DATA = 18;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -47,7 +47,7 @@ static const uint8_t VBAT_SENSE = 4;
static const uint8_t VBUS_SENSE = 10;
static const uint8_t RGB_DATA = 23;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -66,7 +66,7 @@ static const uint8_t VBAT_SENSE = 3;
static const uint8_t VBUS_SENSE = 21;
static const uint8_t RGB_DATA = 1;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -47,7 +47,7 @@ static const uint8_t VBAT_SENSE = 10;
static const uint8_t VBUS_SENSE = 33;
static const uint8_t RGB_DATA = 18;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
......
......@@ -4,13 +4,13 @@
#include <stdint.h>
#include "soc/soc_caps.h"
// Neopixel
#define PIN_NEOPIXEL 0 // ->2812 RGB !!!
// RGB LED
#define PIN_RGB_LED 0 // ->2812 RGB !!!
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
static const uint8_t LED_BUILTIN = (PIN_NEOPIXEL + SOC_GPIO_PIN_COUNT);
static const uint8_t LED_BUILTIN = (PIN_RGB_LED + SOC_GPIO_PIN_COUNT);
#define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
#define RGB_BUILTIN LED_BUILTIN
#define RGB_BRIGHTNESS 64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment