Page 1 of 1

How I can Hide "Mute" message

Posted: Mon Nov 12, 2018 7:24 am
by YSRAHMED
8) good day from Egypte

-I am a new User for ٍ{ The Strong Flowcode } ----> I do an alarm for 3 normal open points (3 switches ) interfacing pic 16 f877a
-The operation depend on when every normal open points are closed ---> give Buzzer sound and display the name of points so I do "Mute" for silent and display it -----the problem is How I can Hide "Mute" message when second switch is pressed also when the third is pressed

Re: How I can Hide "Mute" message

Posted: Mon Nov 12, 2018 9:59 am
by mnf
Hi,
Welcome to the forum. Please post your code, or some code that demonstrates what you're trying to achieve and someone will probably be able to help.

Martin

Re: How I can Hide "Mute" message

Posted: Tue Nov 13, 2018 7:41 am
by YSRAHMED
mnf wrote:Hi,
Welcome to the forum. Please post your code, or some code that demonstrates what you're trying to achieve and someone will probably be able to help.

Martin
Good day Martin
How I can Attaching my projects FC File on Page ?

Actually --- > this is my First attempt to make simple project using Flowcode .

Project idea :
- 3 switches(Active Low ) control 3 leds on Output of pic16f877a and display the status on LCD
- when pressed any switch -->{ its led is on && "MUTE" Appears on the LCD BY B0 interruption for stop buzzer sound }

- :roll: I need for understand How I Can :

1- add Buzzer Joinet pin B7 ( Intermittent sound) when any switch is closed its contacts.
2- Hiding ASCII "MUTE" when second switch is ON and Buzzer is ON .
- so if I pressed Mute push Button for mute sound agine , the third switch is Hiding ASCII "MUTE" and Buzzer is ON when I pressed it.
3 - Mute the Buzzer sound When 3 switches are ON and display "MUTE" .

thanks alot

Re: How I can Hide "Mute" message

Posted: Tue Nov 13, 2018 8:05 am
by Steve001
YSRAHMED

How I can Attaching my projects FC File on Page ?
Actually --- > this is my First attempt to make simple project using Flowcode .
Hi Ysrahmed

to add files to the forum post click the "Attachments" tab
then Click the "Add files Button"
a box opens then you select your file

Please be aware certain file types are not allowed, also be aware of file size as people look on mobile devices

Steve

Re: How I can Hide "Mute" message

Posted: Tue Nov 13, 2018 11:39 am
by YSRAHMED
How I can Attaching my projects FC File on Page ?
Actually --- > this is my First attempt to make simple project using Flowcode .
[/quote]

Hi Ysrahmed

to add files to the forum post click the "Attachments" tab
then Click the "Add files Button"
a box opens then you select your file

Please be aware certain file types are not allowed, also be aware of file size as people look on mobile devices

Steve[/quote]


Thanks a lot Steve
3NO-sensoers.fcf
(35.88 KiB) Downloaded 299 times
[quote="Steve001"][quote]YSRAHMED

Re: How I can Hide "Mute" message

Posted: Tue Nov 13, 2018 8:15 pm
by mnf
Hi,

You are currently setting the display to show 'Mute' in the interrupt handler.
This is probably a bad idea (writing to the display during an interrupt - what happens if an interrupt occurs whilst the main loop is writing to the display?) - a better bet would be to have a flag. For example: a global variable byte state where state = 0 (alarm off - everything normal), state = 1 (alarm sounding) and state = 2 (Alarm muted) etc
It would be good practice to define these values as constants too.

Then in the interrupt handler (int) just set state = 2 (or, better, state = MUTED)

In the main loop have an extra variable (say current_state) and then if current_state != state, set current_state = state and change the LCD output.

Note that maintaining the current display state and the new state allows the display to only be rewritten if the value has changed.

Hope this helps a bit - I can demonstrate in more detail if needed (when not using my phone to add the message)

Martin