Good evening. I’m trying to send through Lora (Overview | Adafruit Feather M0 Radio with LoRa Radio Module | Adafruit Learning System) the values obtained with the RGB sensor (TCS34725). I am using this simple code for testing.
#include <Wire.h>
#include "Adafruit_TCS34725.h"
#define commonAnode true
// our RGB -> eye-recognized gamma color
byte gammatable[256];
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);
void setup() {
Serial.begin(9600);
//Serial.println("Color View Test!");
if (tcs.begin()) {
//Serial.println("Found sensor");
} else {
Serial.println("No TCS34725 found ... check your connections");
while (1); // halt!
}
// it helps convert RGB colors to what humans see
for (int i=0; i<256; i++) {
float x = i;
x /= 255;
x = pow(x, 2.5);
x *= 255;
if (commonAnode) {
gammatable[i] = 255 - x;
} else {
gammatable[i] = x;
}
//Serial.println(gammatable[i]);
}
}
void loop() {
float red, green, blue;
tcs.setInterrupt(false); // turn on LED
delay(60); // takes 50ms to read
tcs.getRGB(&red, &green, &blue);
tcs.setInterrupt(true); // turn off LED
Serial.println(int(red));
Serial.println(int(green));
Serial.println(int(blue));
Serial.print("\n");
}
It works perfectly with my Arduino UNO but when I try to use the same with the Feather (everything is OK) it shows a blank Serial Monitor. If i just upload a Serial.print(“hello”) it will work, but not with the tcs. I am going crazy.
Thanks