Loop keeps repeating
Posted: Mon Aug 19, 2013 10:54 pm
Hello,
While looking on the net for how PIC microprocessors work just out of interest and maybe how to program these for my hobby I found this great program Flowcode and a free downgraded trail version perfect for testing if it would suit my needs…
Because I have programmers at my disposal from my work like Pickit3 and a Galep-5 it’s fun to try and explore… I have read and played some already and found a goal to make.. I stumbled upon all kind of small issues but found most answers on this forum.. (watchdog timer, spaces in the filename (sigh … Grrr ))
I now have something I cant get sorted and tried a lot. I made a program with two leds. One led (2) is lit when no input is given. When the input is switched ‘on’ the second led (1) pulses, together with led 2 on/off for 3 times and then both remain solid 'on' until the switch is released again.
When I run the program in demo it does exactly what I want (have found two ways to do that actually). But when I load the program in the PIC it keeps flashing like it does not see the ‘second part’ of the line where two leds need to stay solid ‘on’ until the switch is released. It ‘skips’ a part and starts it’s line from top again writing the line again resulting in a repeating flash. when I replace the last both leds solid on by a output and a delay it works but does not react on releasing the switch obviously.
Both loops separately programmed does work fine.
....... Help.
While looking on the net for how PIC microprocessors work just out of interest and maybe how to program these for my hobby I found this great program Flowcode and a free downgraded trail version perfect for testing if it would suit my needs…
Because I have programmers at my disposal from my work like Pickit3 and a Galep-5 it’s fun to try and explore… I have read and played some already and found a goal to make.. I stumbled upon all kind of small issues but found most answers on this forum.. (watchdog timer, spaces in the filename (sigh … Grrr ))
I now have something I cant get sorted and tried a lot. I made a program with two leds. One led (2) is lit when no input is given. When the input is switched ‘on’ the second led (1) pulses, together with led 2 on/off for 3 times and then both remain solid 'on' until the switch is released again.
When I run the program in demo it does exactly what I want (have found two ways to do that actually). But when I load the program in the PIC it keeps flashing like it does not see the ‘second part’ of the line where two leds need to stay solid ‘on’ until the switch is released. It ‘skips’ a part and starts it’s line from top again writing the line again resulting in a repeating flash. when I replace the last both leds solid on by a output and a delay it works but does not react on releasing the switch obviously.
Both loops separately programmed does work fine.
....... Help.