TCS 3472 | ||
Avant le Setup | Importation de la bibliothèque | #include #include "Adafruit_TCS34725.h" |
Initialisation de l'objet | Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_614MS, TCS34725_GAIN_1X); | |
Dans le Setup | Configuration de l'objet | if (tcs.begin()) { Serial.println("Capteur Trouvé"); } else { Serial.println("Aucun TCS34725 trouvé ... vérifie la connections"); while (1); } |
Dans le Loop | Utilisation | uint16_t r, g, b, c, colorTemp, lux; tcs.getRawData(&r, &g, &b, &c); colorTemp = tcs.calculateColorTemperature_dn40(r, g, b, c); lux = tcs.calculateLux(r, g, b); Serial.println("Détection des couleurs"); Serial.print("Lux: "); Serial.println(lux, DEC); Serial.print("ROUGE: "); Serial.println(r, DEC); Serial.print("VERT: "); Serial.println(g, DEC); Serial.print("BLEU: "); Serial.println(b, DEC); |
#include
#include "Adafruit_TCS34725.h"
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_614MS, TCS34725_GAIN_1X);
void setup() {
Serial.begin(9600);
if (tcs.begin()) {
Serial.println("Capteur Trouvé");
} else {
Serial.println("Aucun TCS34725 trouvé ... vérifier la connections");
while (1);
}
}
void loop() {
uint16_t r, g, b, c, colorTemp, lux;
tcs.getRawData(&r, &g, &b, &c);
colorTemp = tcs.calculateColorTemperature_dn40(r, g, b, c);
lux = tcs.calculateLux(r, g, b);
Serial.println("Détection des couleurs");
Serial.print("Lux: ");
Serial.println(lux, DEC);
Serial.print("ROUGE: ");
Serial.println(r, DEC);
Serial.print("VERT: ");
Serial.println(g, DEC);
Serial.print("BLEU: ");
Serial.println(b, DEC);
}
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #