Hi panuj417 ,
I have moved your post, so not hijacking a members topic.
One issue is you are reading the value of a button, if the value is true, then the loop is accessed.
There is not a button to read within the loop, so the value will never go from 1 to 0.
You can just place another Button ReadState within the loop.
You also have some issues with your configuration.
For example Watchdog and Low voltage programming is enabled, which will cause issues.
With loads of chips including PIC16F886, It is the value of
register that set up the hardware internal osc speed.
The Clock speed within Flowcode sets up timing for all timed critical components and delays.
Looking at the data sheet (page 62) for PIC16F886 the default value is 4MHz.
This means no matter what you set the clock value to, the chip will always be running at 4MHz!
To get the hardware to run at the correct speed, the easiest way within Flowcode is to use the
intosc component.
Just click on the search(magnifying glass) and enter
intosc
This is how you use the intosc component.
Please follow it all, as you will need to add a C code bock with the correct value.
Whenever I start a project with a new target device, I always run a
flash test to make sure the chip is running at the correct speed.