Go Down

Topic: It is possible to use the color sensor TCS3200 on Pro Micro ?  (Read 107 times) previous topic - next topic

AlexLPD

Hi to you all.

Im currently shrinking a old project, (A color sensor connected to Arduino, when recognize a certain colour, opens a relay)

The device works well on a regular Arduino Uno, but as I mentioned I like to shrink it, to step up to some Arduino Pro Mini.

The program uses the fabulous https://github.com/MajicDesigns/MD_TCS230

A very nice color sensing library, since the color sensor output a frequency for the data, the above library it uses;

https://www.pjrc.com/teensy/td_libs_FreqCount.html

This one from Teensy.

Or if you like you can look at GitHub

https://github.com/PaulStoffregen/FreqCount

Know, the library only can read the DP5, On the Arduino Uno  since this is the "Timmer 1" or T1
(I get this from here.)

Know On the oficial Arduino Page the DP5 is in deed Timmer 1: Here !

But in the Arduino Pro Micro AtMega 32u4:

The datasheet says the T1 is pin 26 of the uC:  http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf

And following the Schematics: the pin 26 of the uC it is the Digital Pin 6 on the Arduino Pro Mini:
https://www.arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf.

So theoretically it must work on the Arduino Pro Micro, but on This post , the actual creator of the library says to me the "Pin 5 is har-coded on the library).

So the question is; Its is necessary to edit the library if it, how?
Or it automatically directs to any Timmer 1, of the processor ?

Thanks in advance.
-Alex.

Paul__B

A Pro Mini has all the same functionality of a UNO except for the USB to serial adapter which you have to provide separately in order to program it or use the Serial Monitor.  As long as you connect to pin 5 on the Pro Mini, the same code will work.

AlexLPD

A Pro Mini has all the same functionality of a UNO except for the USB to serial adapter which you have to provide separately in order to program it or use the Serial Monitor.  As long as you connect to pin 5 on the Pro Mini, the same code will work.
Thanks Paul, I will give it a try! .
-Alex.

Paul__B

Apologies there!

I said a Pro Mini has all the same functionality of a UNO etc. because it uses the same ATmega328 processor.

I mis-read.  You refer to a Pro Micro and it does have somewhat different behaviour.  Functionality is similar, but the code requires tweaks!

AlexLPD

Tweaks in the color library?
Or in the deep arduino core?

Im never do something like this, either so, I dont Know were to start.

I assume there the pin order it is the one describe above (about the T1, pin) ???

-Alex.

Paul__B

It would be tweaks in the user code, but I am not sufficiently familiar with the Leonardo/ Pro Micro/ Leostick.  I could not get my Leostick to work back in 2013 and kind of gave up on it!  :smiley-eek:

AlexLPD

Hi, Thanks Paul, I think I will do a test on a Mini, and if all goes well, will changue the pcb is cheaper and faster.

Still, if anybody know how to use the Frequency count on a Pro Mini, I will thank you !!!

-Alex.

Go Up