Hi all,
I want in a certain desicion to stop the program. I used the C-code exit(0); But I got a C-code error. What to do?
Thanks for your help
Jan
Dead end
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Dead end
Hi Jan
I would not a thought just stopping a program would not reset variables anyway.
Im with Steve. So expanding on the endless loop.
Can’t you have an endless loop as Steve suggested, but inside the loop set all variables to 0 (or set variables, o/p's etc to 0 at the beginning of the interrupt macro).
The endless loop can be called via RB0 external int?
So if RB0 goes high or low, the macro will be instantly called that resets all variables.
That would be a fast dead end!
Martin
I would not a thought just stopping a program would not reset variables anyway.
Im with Steve. So expanding on the endless loop.
Can’t you have an endless loop as Steve suggested, but inside the loop set all variables to 0 (or set variables, o/p's etc to 0 at the beginning of the interrupt macro).
The endless loop can be called via RB0 external int?
So if RB0 goes high or low, the macro will be instantly called that resets all variables.
That would be a fast dead end!
Martin
Martin
- 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: Dead end
Hello,
If you can rig up a PNP transistor to your MCLR signal then pulling the base of the transistor high would effectivly stop your device and reset all the I/O registers etc. If you have a latch on your base signal too then the latch would stop the device from running again until you reset the latch.
If you can rig up a PNP transistor to your MCLR signal then pulling the base of the transistor high would effectivly stop your device and reset all the I/O registers etc. If you have a latch on your base signal too then the latch would stop the device from running again until you reset the latch.
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