ColorSensor (TCS3472X I2C COLOR SENSOR) Libary error??? #1604
Replies: 22 comments
-
Posted at 2016-05-09 by @gfwilliams Looks like the color sensor has come disconnected? Check Power, GND, and the I2C wires. Depending on the sensor, you might need pullup resistors on SDA and SCL too. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by Jaksi It has worked so far... this is the code we are using; I2C1.setup({scl:B6, sda:B7}); var v = tcs.getValue(); The Color sensor is lighting up, but won't read any value. Do you think it's broken? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by @gfwilliams No, I think it's probably wiring, or you're missing pullups (which would make it unreliable). Also check the voltage on the 3.3v line - if you had a Pico rev 1.3 board and shorted it out then you might have damaged a diode on it, in which case it might not be able to provide enough power to light the lights and provide enough voltage to make the sensor work. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by Jaksi Do you think the Tcs3200 would work? http://softgenie.dk/sensor/362-farve-sensor.html We might have to get a new one.. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by @gfwilliams No, I'm afraid it's a totally different (non-I2C) interface on it - you'd have to get one of the same type as before. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by Jaksi ah okay.. Thank you for your help! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by @gfwilliams No, I have no idea what code you'd want for Arduino - I'd imagine Google should turn something up quite quick though. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by DrAzzy How does a color sensor "light up" ? Are you using one on a breakout board with additional parts, including leds? Which one? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by @gfwilliams Chances are it's this one: https://www.adafruit.com/product/1334 I think the LED just comes on when you add power to it (or maybe you have to with the 'light' pin up - either way it doesn't need I2C) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-13 by Jaksi Hi Gordon /Jakob |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-13 by @gfwilliams Great - glad you got it working! If you didn't mind sharing in publicly it'd be good if you could just post the code up here? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-13 by DrAzzy Oh nice, you got a TCS3200 working with Espruino? Shame you couldn't figure out what went wrong with the 3472, but I'm sure people would love to see code for a TCS3200 - those are a lot more common, and they're easier to build into a home-made board as well; that DFN-6 package is no fun to solder down. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-25 by Kajsat Hello, tell a beginner: TCS3472x I2C Color Sensor Library https://www.espruino.com/TCS3472x How does it work? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-28 by Kajsat
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-28 by Kajsat Hello, tell a beginner: TCS3472x I2C Color Sensor Library https://www.espruino.com/TCS3472x How does it work? Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-29 by @gfwilliams Hi - I'm pretty sure it's working and I have used it in the past myself. Espruino doesn't have the modules built in to the IDE, but loads them on demand when they are referenced - see http://www.espruino.com/Modules#espruino-modules |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-29 by Kajsat Thank you for the answer.) Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-30 by @gfwilliams b. You just copy the example code from https://www.espruino.com/TCS3472x into the right-hand side of the Web IDE and click 'upload' This is all you need to have for code, no module download is required:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-30 by Kajsat Got it, thanks! Kind man =) Just confused by the designation "TCS3472x" in "var tcs=require("TCS3472x").connect(I2C1, 1 /integration cycles/, 1 /gain/);", and I did not understand how I could access a library that I did not find in the libraries connected in espruino/modules, and did not understand how it works inside the program. Now, at least I know that I don't need to install anything extra, thanks to you. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-03-30 by @gfwilliams Great! the actual library that gets loaded automatically is http://www.espruino.com/modules/TCS3472x.js |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-04-01 by Kajsat Hello, the sensor works when you press the RAM key, but when you enter save() in the left window, and disconnect the device from the power supply and reconnect (com), it gives an error: in function called from system What to do, how to continue reading data to the console again after restarting the power supply? PrimaryI2C.setup({sda: SDA, scl: SCL, bitrate: 100000}); var colorSensor = require("TCS3472x").connect(PrimaryI2C, 1, 1); var PIN_BACKLIGHT = P5; digitalWrite(PIN_BACKLIGHT, true); setInterval(function() { if ((r > g) && (r > b)) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-04-01 by @gfwilliams See the
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-09 by Jaksi
Hi.
I'm currently doing a school project including an Espruino, LEDs and the color sensor. It has worked out great, but suddenly an error message occurs. Please help us - we have to show our project to the whole University in 3 days!
/Jakob, IT-University, Copenhagen
The error code is shown in the picture!
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions