I am trying to run 2 TCS3200’sTCS3200
’s from one Arduino DueArduino Due
. Next, I must increase to 4 sensors. I need to read the data from the 2 digital pins but how do I read both within the same loop rather than in series to save time. The code reading one sensor tasoOutPin1 (pin 10) works but why can’t I place the second read command ‘int detectColor(int taosOutPin2)’int detectColor(int taosOutPin2)
before the {{
symbol?
int detectColor(int taosOutPin1) {
float white1 = colorRead(taosOutPin1,0,1); float red1 = colorRead(taosOutPin1,1,1); float blue1 = colorRead(taosOutPin1,2,1); float green1 = colorRead(taosOutPin1,3,1); }
int detectColor(int taosOutPin1) {
float white1 = colorRead(taosOutPin1,0,1);
float red1 = colorRead(taosOutPin1,1,1);
float blue1 = colorRead(taosOutPin1,2,1);
float green1 = colorRead(taosOutPin1,3,1);
}
Thanks,
Scott
I am trying to run 2 TCS3200’s from one Arduino Due. Next, I must increase to 4 sensors. I need to read the data from the 2 digital pins but how do I read both within the same loop rather than in series to save time. The code reading one sensor tasoOutPin1 (pin 10) works but why can’t I place the second read command ‘int detectColor(int taosOutPin2)’ before the { symbol?
int detectColor(int taosOutPin1) {
float white1 = colorRead(taosOutPin1,0,1); float red1 = colorRead(taosOutPin1,1,1); float blue1 = colorRead(taosOutPin1,2,1); float green1 = colorRead(taosOutPin1,3,1); }
Thanks,
Scott
I am trying to run 2 TCS3200
’s from one Arduino Due
. Next, I must increase to 4 sensors. I need to read the data from the 2 digital pins but how do I read both within the same loop rather than in series to save time. The code reading one sensor tasoOutPin1 (pin 10) works but why can’t I place the second read command int detectColor(int taosOutPin2)
before the {
symbol?
int detectColor(int taosOutPin1) {
float white1 = colorRead(taosOutPin1,0,1);
float red1 = colorRead(taosOutPin1,1,1);
float blue1 = colorRead(taosOutPin1,2,1);
float green1 = colorRead(taosOutPin1,3,1);
}
Thanks,
Scott
Arduino Due: multiple TCS sensors
I am trying to run 2 TCS3200’s from one Arduino Due. Next, I must increase to 4 sensors. I need to read the data from the 2 digital pins but how do I read both within the same loop rather than in series to save time. The code reading one sensor tasoOutPin1 (pin 10) works but why can’t I place the second read command ‘int detectColor(int taosOutPin2)’ before the { symbol?
int detectColor(int taosOutPin1) {
float white1 = colorRead(taosOutPin1,0,1); float red1 = colorRead(taosOutPin1,1,1); float blue1 = colorRead(taosOutPin1,2,1); float green1 = colorRead(taosOutPin1,3,1); }
Thanks,
Scott