Hello.
I am trying to make a simple RGB rainbow in Flowcode V5, using the built-in LED RGB and a loop which slowly increases each color from 1 to 255 and make a TICK after each time.
The simulation works perfectly but when I try it out for real, it flickers and looks horrible, almost like it can't make the fine adjustments required for a smooth transition. I am using the PIC16F628A chip.
I have looked for solutions for several days now but I can't seem to get anything to work. the PIC is connected directly to the RGB LED with 330 Ohm resisters in between.
I have included the Flowcode file. It is also worth mentioning that I have access to the following PICs, if they would work better: 16F628, 16F676, 16F688, 16F84, 18F13K50, 16F88, 16F648A and 18F4550.
If anyone could tell me what I am doing wrong, I would be very grateful.
Uneven RGB Rainbow
Moderator: Benj
-
- Posts: 8
- Joined: Mon Feb 26, 2018 11:45 am
- Been thanked: 1 time
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Uneven RGB Rainbow
Hello,
Try this, I'm now calling the Tick macro as part of a regular timer interrupt, this allows the LED to take care of itself while you are free to set the colour variables. Refresh rate is now around 52Hz. To modify this edit the properties of the timer 2 interrupt. the refresh rate is the interrupt frequency divided by 256.
Try this, I'm now calling the Tick macro as part of a regular timer interrupt, this allows the LED to take care of itself while you are free to set the colour variables. Refresh rate is now around 52Hz. To modify this edit the properties of the timer 2 interrupt. the refresh rate is the interrupt frequency divided by 256.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 8
- Joined: Mon Feb 26, 2018 11:45 am
- Been thanked: 1 time
- Contact: