How I can Hide "Mute" message

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

YSRAHMED
Posts: 4
Joined: Mon Feb 26, 2018 8:46 am
Contact:

How I can Hide "Mute" message

Postby YSRAHMED » Mon Nov 12, 2018 7:24 am

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

mnf
Valued Contributor
Valued Contributor
Posts: 562
Joined: Wed May 31, 2017 11:57 am
Has thanked: 54 times
Been thanked: 314 times
Contact:

Re: How I can Hide "Mute" message

Postby mnf » Mon Nov 12, 2018 9:59 am

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
These users thanked the author mnf for the post:
Benj (Mon Nov 12, 2018 3:58 pm)
Rating: 5.26%
 

YSRAHMED
Posts: 4
Joined: Mon Feb 26, 2018 8:46 am
Contact:

Re: How I can Hide "Mute" message

Postby YSRAHMED » Tue Nov 13, 2018 7:41 am

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 }

[b]- :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

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1086
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 440 times
Been thanked: 492 times
Contact:

Re: How I can Hide "Mute" message

Postby Steve001 » Tue Nov 13, 2018 8:05 am

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
Attachments
Capture1.JPG
Capture1.JPG (30.27 KiB) Viewed 1404 times
Capture.JPG
Capture.JPG (31.16 KiB) Viewed 1404 times
Success always occurs in private and failure in full view.

YSRAHMED
Posts: 4
Joined: Mon Feb 26, 2018 8:46 am
Contact:

Re: How I can Hide "Mute" message

Postby YSRAHMED » Tue Nov 13, 2018 11:39 am

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 46 times
[quote="Steve001"][quote]YSRAHMED

mnf
Valued Contributor
Valued Contributor
Posts: 562
Joined: Wed May 31, 2017 11:57 am
Has thanked: 54 times
Been thanked: 314 times
Contact:

Re: How I can Hide "Mute" message

Postby mnf » Tue Nov 13, 2018 8:15 pm

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