-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
299d330
commit b799f5c
Showing
9 changed files
with
160 additions
and
1,338 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
597 changes: 0 additions & 597 deletions
597
2_Firmware/2_SensorPressure_BMP280/.vscode/c_cpp_properties.json
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
2_Firmware/3_SensorRGBWLight_VEML6040/3_SensorRGBWLight_VEML6040.ino
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,76 @@ | ||
/* | ||
* Last Update: 17/11/2023 | ||
* Author: Andrea Sauviat | ||
* E-mail: [email protected] | ||
* | ||
* Description: How to use the RGBW Light sensor ? | ||
* | ||
* GitHub : https://github.com/SauviaTron/Mini_RAK-Tracker | ||
* Datasheet : https://www.vishay.com/docs/84276/veml6040.pdf | ||
* | ||
*/ | ||
|
||
|
||
// > The libraries you need : | ||
#include <Wire.h> // For I2C | ||
#include "VEML6040.h" // In order to use the VEML6040 | ||
|
||
|
||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
// GLOBAL VARIABLES // | ||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
|
||
VEML6040 RGBWSensor; | ||
uint16_t Red, Green, Blue, White, CCT ; | ||
float AmbientLight ; | ||
|
||
bool Enable_SerialPrint = true ; // Display information or not on the serial monitor | ||
|
||
|
||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
// SETUP() // | ||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
|
||
void setup() { | ||
|
||
// > Configure the baud rate | ||
Serial.begin( 115200 ) ; | ||
while ( !Serial ) {} ; // Wait for the serial to be available | ||
delay(2500) ; // Add a custom delay for user to 'see' the setup function | ||
|
||
|
||
// > Welcome Msg | ||
Serial.println( "Welcome to the VEML6040 test program ! " ) ; | ||
|
||
|
||
// > Configure the I2C | ||
Wire.begin(); | ||
|
||
|
||
// > Configure the RGBW Light Sensor | ||
if( !RGBWSensor.begin() ) { // If the sensor can not boot up | ||
Serial.println("ERROR: couldn't detect the sensor"); // Display n error msg | ||
while(1){} // Do nothing | ||
} | ||
RGBWSensor.Configuration( ); | ||
// If you want to change the operating mode, the sampling and so on, that in the VEML6040_Configuration function. | ||
|
||
} | ||
|
||
|
||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
// LOOP() // | ||
// —————————————————————————————————————————————————————————————————————————————————————————————— // | ||
|
||
void loop() { | ||
|
||
// > New loop | ||
Serial.println("."); | ||
|
||
RGBWSensor.Configuration() ; delay(325) ; // Adding delay to the sensor wake-up | ||
RGBWSensor.getData(&Red, &Green, &Blue, &White, &AmbientLight, &CCT ); // Get Sensor info | ||
RGBWSensor.Sleep(); // Put back the sensor to sleep mode | ||
|
||
delay(1000); | ||
|
||
} |
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