Can't get switches to work in the simulator

For general Flowcode discussion that does not belong in the other sections.
chipfryer27
Valued Contributor
Posts: 1813
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 622 times

Re: Can't get switches to work in the simulator

Post by chipfryer27 »

Hi

Would you please attach a chart showing the issue?

Regards

chipfryer27
Valued Contributor
Posts: 1813
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 622 times

Re: Can't get switches to work in the simulator

Post by chipfryer27 »

Hi

Attached is a very basic chart which uses an interupt to change the status of an LED.

IOC_Example.fcfx
(13.37 KiB) Downloaded 6 times


It loops doing nothing more than displaying the status of a variable called "Flag"

Prior to the loop we set an Interrupt On Change (IOC) connected to a push button, Upon each press (rising edge) we branch to User Macro ISR and swap the state of variable "Flag"

When you press the button during simulation, you will see the status on the switch change from "Off" to "On". Releasing sets it back to "Off". When pressed the button changes colour to blue.

This is using a PIC16F1939.

If you can show a similar chart with your issue I'm sure we can assist further.

Regards

Post Reply