I have a simple PIC12F629 and programmed in Flowcode seven LED flash patterns. With a button you activate the next pattern.
Now I want to use a potentiometer to adjust the flash speed (delays) of the flash patterns. I can imagine that this is not so easy to do because my flash pattern have a standard delay (50ms) in the flowchart.
Somewhere in this forum I found a year ago a flowchart what seems to do this, but I can’t find it anymore.
Anyone who can help me?
Controlling with a pot the speed of flash patterns
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Controlling with a pot the speed of flash patterns
Hi Martin,
Thanks for the link to the topic. I have got my flowchart working with a potentiometer according
to your post.
But one thing I don’t understand very well and that is the calculation:
The value is now 100ms to 500ms. How can I have 50ms >450ms ?
Thanks for the link to the topic. I have got my flowchart working with a potentiometer according
to your post.
But one thing I don’t understand very well and that is the calculation:
Code: Select all
Note the calculation
CODE: SELECT ALL
Delay = Delay * 16 / 10 + 100
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Controlling with a pot the speed of flash patterns
Hi Frank,
It should be very near is using ReadAsByte.
Probably 50 to 447ms?
Is that accurate enough?
That's because of:Frank607 wrote:The value is now 100ms to 500ms.
medelec35 wrote: Note the calculationuse within the flowchart I posted just takes the digital value derived by ADC (0 to 255) and converts it in to a value suitable for a milliseconds delay (about 100 to just over 500)Code: Select all
Delay = Delay * 16 / 10 + 100
You can try:Frank607 wrote:How can I have 50ms >450ms ?
Code: Select all
Delay = Delay * 39 / 25 + 50
Probably 50 to 447ms?
Is that accurate enough?
Martin