Blazemaguire
Senior Member
Hi guys,
I have a student who is producing a PICAXE18X based GCSE coursework project that is essentially a novelty lighting system (think christmass tree lights that you can change the lighting sequence and ALSO the speed of the flashing / sequence.
We have a 10k potentiometer connected as an analogue input (for selecting the speed of flashing), and 3 PTM switches to the other inputs to act as 'sequence selectors' e.g Flashing / alternating /nightrider style etc. And just 8 high powered LED's taking up all the outputs.
We are using PIC Logicator ver 2 to do the programming, as BASIC code is beyond my students capabilities. -
We are having trouble trying to get the analogue input to determine the 'WAIT' period between output changes.
For those familiar with logicator:
So far we have tried writing the value of the analogue input into variable 'A' (which writes in a arbitary value between 0 and 255 depending on the position of the potentiometer) using the EXPRESSION command. - Then using the WAIT command, between turning on and off OUTPUTS you can select to use the value of variable 'A' instead of typing in a time period - hence the speed of each lighting sequence would be proportional to the position of the potentiometer. - now when you simulate this in logicator, it works to a degree, and when you download it to the chip and plug into the PCB it works to a degree (i.e you can see that the POT is definatly having an effect on the speed of pulsing) however it does not have anywhere enough adjustability.
We would like the speed of pulsing to vary from about 2 seconds between pulses to almost faster than the eye can see between the two extremes of movement of the potentiometer.
I am stuck as to how to achieve this, I cannot get a number higher than 255 to be stored in the variable 'A' using logicator, even if I use adition or multiplication of the number. - I think the WAIT command is using the value 255 in A to mean 255 miliseconds, where we would obviously need 2000 to get the maximum 2 seconds delay that we need.
Can I do this with components easily? or would proper BASIC code allow for what we want to achieve? - If so could someone suggest a suitable piece of code that I could look at ( I myself know enough about basic to understand whats going on, and could maybe program the chip without logicator if necessary).
Thanks for reading this essay!
Rob
I have a student who is producing a PICAXE18X based GCSE coursework project that is essentially a novelty lighting system (think christmass tree lights that you can change the lighting sequence and ALSO the speed of the flashing / sequence.
We have a 10k potentiometer connected as an analogue input (for selecting the speed of flashing), and 3 PTM switches to the other inputs to act as 'sequence selectors' e.g Flashing / alternating /nightrider style etc. And just 8 high powered LED's taking up all the outputs.
We are using PIC Logicator ver 2 to do the programming, as BASIC code is beyond my students capabilities. -
We are having trouble trying to get the analogue input to determine the 'WAIT' period between output changes.
For those familiar with logicator:
So far we have tried writing the value of the analogue input into variable 'A' (which writes in a arbitary value between 0 and 255 depending on the position of the potentiometer) using the EXPRESSION command. - Then using the WAIT command, between turning on and off OUTPUTS you can select to use the value of variable 'A' instead of typing in a time period - hence the speed of each lighting sequence would be proportional to the position of the potentiometer. - now when you simulate this in logicator, it works to a degree, and when you download it to the chip and plug into the PCB it works to a degree (i.e you can see that the POT is definatly having an effect on the speed of pulsing) however it does not have anywhere enough adjustability.
We would like the speed of pulsing to vary from about 2 seconds between pulses to almost faster than the eye can see between the two extremes of movement of the potentiometer.
I am stuck as to how to achieve this, I cannot get a number higher than 255 to be stored in the variable 'A' using logicator, even if I use adition or multiplication of the number. - I think the WAIT command is using the value 255 in A to mean 255 miliseconds, where we would obviously need 2000 to get the maximum 2 seconds delay that we need.
Can I do this with components easily? or would proper BASIC code allow for what we want to achieve? - If so could someone suggest a suitable piece of code that I could look at ( I myself know enough about basic to understand whats going on, and could maybe program the chip without logicator if necessary).
Thanks for reading this essay!
Rob
Last edited: