-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from arduino-libraries/white-led-rename
Replace occurrences of white LED with orange LED
- Loading branch information
Showing
9 changed files
with
94 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/** | ||
* This example shows how to control the white LED on the Nicla Sense Env board. | ||
* This example shows how to control the orange LED on the Nicla Sense Env board. | ||
* | ||
* Initial author: Sebastian Romero ([email protected]) | ||
*/ | ||
|
||
#include "NiclaSenseEnv.h" | ||
|
||
void pulseLED(WhiteLED& led) { | ||
void pulseLED(OrangeLED& led) { | ||
// Fade in | ||
for (uint8_t i = 0; i < 64; ++i) { | ||
led.setBrightness(i); | ||
|
@@ -29,17 +29,17 @@ void setup() { | |
NiclaSenseEnv device; | ||
|
||
if (device.begin()) { | ||
auto whiteLED = device.whiteLED(); | ||
auto orangeLED = device.orangeLED(); | ||
|
||
Serial.print("🔢 White LED error status enabled: "); | ||
Serial.println(whiteLED.errorStatusEnabled()); | ||
Serial.print("💡 White LED brightness: "); | ||
Serial.println(whiteLED.brightness()); | ||
Serial.print("🔢 Orange LED error status enabled: "); | ||
Serial.println(orangeLED.errorStatusEnabled()); | ||
Serial.print("💡 Orange LED brightness: "); | ||
Serial.println(orangeLED.brightness()); | ||
|
||
pulseLED(whiteLED); | ||
pulseLED(orangeLED); | ||
|
||
// Enable sensor error indication on white LED (LED should turn off if sensors are okay) | ||
whiteLED.setErrorStatusEnabled(true); | ||
// Enable sensor error indication on orange LED (LED should turn off if sensors are okay) | ||
orangeLED.setErrorStatusEnabled(true); | ||
} else { | ||
Serial.println("🤷 Device could not be found. Please double-check the wiring."); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ version=1.0.0 | |
author=Arduino | ||
maintainer=Arduino <[email protected]> | ||
sentence=Read sensor data from the Nicla Sense Env board and control the board behaviour. | ||
paragraph=This library comes with the following features to interact with the Nicla Sense Env board: RGB LED control, White LED control, Board control (sleep, reset, factory reset), Board configuration (e.g. changing the I2C address or enabling UART CSV output), Indoor Air Quality Sensor control, Outdoor Air Quality Sensor control, Temperature/Humidity Sensor Control, UART CSV output | ||
paragraph=This library comes with the following features to interact with the Nicla Sense Env board: RGB LED control, Orange LED control, Board control (sleep, reset, factory reset), Board configuration (e.g. changing the I2C address or enabling UART CSV output), Indoor Air Quality Sensor control, Outdoor Air Quality Sensor control, Temperature/Humidity Sensor Control, UART CSV output | ||
category=Device Control | ||
url=https://github.com/arduino-libraries/Arduino_NiclaSenseEnv | ||
architectures=samd,mbed_portenta,renesas_portenta,renesas_uno,mbed_nicla,esp32,mbed_nano | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "I2CDevice.h" | ||
|
||
/** | ||
* @brief Represents the orange on-board LED controlled via I2C. | ||
* | ||
* The OrangeLED class provides methods to control the brightness and error status of the orange LED. | ||
* It inherits from the I2CDevice class. | ||
*/ | ||
class OrangeLED : public I2CDevice { | ||
public: | ||
|
||
/** | ||
* @brief Constructs a OrangeLED object. | ||
* | ||
* @param bus The I2C bus to use (default is Wire). | ||
* @param deviceAddress The I2C device address (default is 0x21). | ||
*/ | ||
OrangeLED(TwoWire& bus = Wire, uint8_t deviceAddress = DEFAULT_DEVICE_ADDRESS); | ||
|
||
/** | ||
* @brief Constructs a OrangeLED object with the specified device address. | ||
* | ||
* @param deviceAddress The I2C address of the OrangeLED device. | ||
*/ | ||
OrangeLED(uint8_t deviceAddress); | ||
|
||
/** | ||
* Gets the brightness of the orange LED. | ||
* @return The brightness of the orange LED. Range is 0 to 63. | ||
*/ | ||
uint8_t brightness(); | ||
|
||
/** | ||
* Sets the brightness of the orange LED. | ||
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the orange LED brightness to make the change persistent. | ||
* @param brightness : The brightness of the orange LED. Range is 0 to 63. | ||
*/ | ||
void setBrightness(uint8_t brightness = 63); | ||
|
||
/** | ||
* Determines whether the orange LED is used to indicate an error status of one of the sensors. | ||
* @return True if the orange LED is used for error status, false otherwise. | ||
*/ | ||
bool errorStatusEnabled(); | ||
|
||
/** | ||
* Enables or disables the orange LED to indicate an error status of one of the sensors. | ||
* Call storeSettingsInFlash() on NiclaSenseEnv instance after enabling/disabling the orange LED error status to make the change persistent. | ||
* @param enabled : Whether to enable or disable the orange LED error status. | ||
*/ | ||
void setErrorStatusEnabled(bool enabled); | ||
}; |
This file was deleted.
Oops, something went wrong.