Secret Doorbel

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
jacobsg
Posts: 14
Joined: Sun Jun 14, 2009 10:45 am
Has thanked: 2 times
Contact:

Secret Doorbel

Post by jacobsg »

Hi
I am new to flowcode and would like to learn more about flowcode. Could you tell me where I could attend a course on flowcode. I also experience a problem in Bert van Dam's book Microcontroller systems engineering. The secret doorbel works perfect however when you press the hash key (35) it opens the relay everytime. which means the correct code is not deleted after entering it initially. How could I alter the flowcode to clear the correct code from memory? after a delay of say 3 seconds.
Thanks
Gerhard

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: Secret Doorbel

Post by Sean »

The code entered from the keypad is stored in the 'doorbel' array (doorbel[0], doorbel[1], doorbel[2], doorbel[3]). This is compared with the code stored in the 'code' array at the top of the program (code[0], code[1], code[2], code[3]).

To clear the entered code after the doorbell has been activeted, a calculation block can be added to the section headed by the 'All four correct' decision - which activates the LED/doorbell.

The doorbel is controlled by the variable 'correct' which counts the number of digits in 'doorbel' that match the corresponding digits in 'code'. Setting 'correct' to zero should prevent the doorbell from being retriggered by the # key

correct = 0

This block can be placed anywhere in the LED activation branch as the decision has already been made to turn the LED on for 3 seconds.

If you want to make sure the code has been cleared you can also add the following four lines:

doorbel[0] = 0
doorbel[1] = 0
doorbel[2] = 0
doorbel[3] = 0

This will ensure that the code is completely reset after a correct entry

jacobsg
Posts: 14
Joined: Sun Jun 14, 2009 10:45 am
Has thanked: 2 times
Contact:

Re: Secret Doorbel

Post by jacobsg »

Thanks a lot, got it working

Gerhard

Post Reply