AUTOMATIC SANITIZER

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

AUTOMATIC SANITIZER

Post by Derrihj »

Hi every one,Ever since Benj updated the common cathode 7 segment to allow for a HIGH on the output i really wanted to test this and see the new tricks Ben added, i really like the part that says (common Type) were you get to choose if you are gong to use a high or low on the output and also there is ZERO half lit LEDS as you can see my images below, Thanks Benj.So i designed a simple circuit which happens to be an auto Sanitizer, my goal is if an object comes close to the IR-LED/Photodiode pair i get an output on the LM358 which in turn gives me a LOW signal on RA5 of 16f88 through an NPN transistor.Now with a LOW on RA5 variable object is no more equal to ONE so a 1 is added onto variable named PERSON which is also displayed on the 7seg, and then sanitizer is activated to sanitize the user.But i don't know if am doing something wrong because my variable PERSON is raised to 1 before RA5 becomes LOW and keeps on raising without a low on RA5 please take a look at my flowchat and see if am doing something wrong and at this point, the != , <> (NOT EQUAL TO) command don't seem to work correctly.This project is to record upto arround 998 people being sanitized and it will have a record keeper thanks to the Eeprom and many more that it will have to do but now it's still basics with few tasks.
Attachments
Hand Sanitizer.fcfx
(41.06 KiB) Downloaded 156 times
Last edited by Derrihj on Wed Jun 10, 2020 2:53 am, edited 9 times in total.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Images
Attachments
IMG_20200610_015243_437.jpg
IMG_20200610_015243_437.jpg (104.3 KiB) Viewed 6534 times
IMG_20200610_015405_535.jpg
IMG_20200610_015405_535.jpg (129.55 KiB) Viewed 6534 times
IMG_20200610_021147_515.jpg
IMG_20200610_021147_515.jpg (97.69 KiB) Viewed 6534 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

More
Attachments
IMG_20200610_042837_488.jpg
IMG_20200610_042837_488.jpg (113.43 KiB) Viewed 6526 times
IMG_20200610_042531_293.jpg
IMG_20200610_042531_293.jpg (110.33 KiB) Viewed 6526 times
IMG_20200610_021125_354.jpg
IMG_20200610_021125_354.jpg (142.13 KiB) Viewed 6534 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Hi Derrihj,
The issue with your flowchart is you are masking bit 5 of the whole port.
That means when port RA5 = 1 the

Code: Select all

Object
variable will have the value of 2^5 = 32
Therefore you either need to change

Code: Select all

If:Object != 1
to

Code: Select all

If:Object != 32
or you can change it to

Code: Select all

If:Object = 0
etc.
Alternatively, instead of using the whole port and masking 1 pin, just use Single bit option, then you can leave

Code: Select all

If:Object != 1
as it is.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Hi Martin nice to see you and thanks for the quick response ok another thing is when Benj updated this 7seg I guess he deactivated the option of disabling the common pin inorder to use the output instead to trigger the digits yet that option is really helpful for low space chips like am using here.I realized using component macro to trigger digits takes much more mcu space than when you use the output and port masking Dear Ben could you please reactivate that option too cause I tried it with this updated version and it didn't work it would be of great help in this simple project like mine since i only have the 16f88 with me because when I upload my finished code with outputs and port masking it fits into the chip "right on the money" but doesn't work and when I load the same code but with component macro for digit triggering Bom i get this annoying message of low space i find my self cutting out my important code trying to fit it in there Thanks Benj for the good work i hope you are somewhere looking at what am trying to say.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Hi Derrihj,
Your're welcome.
Derrihj wrote:I guess he deactivated the option of disabling the common pin inorder to use the output instead to trigger the digits yet that option is really helpful for low space chips like am using here
This could easily be missed on this topic.
If i was you, I would edit your post to remove all the reference to the component and start a new topic.
Here is the properties to the 7seg display:
7Seg properties.png
(93.11 KiB) Downloaded 119 times
The option to have pin a common pin is still there, unless I have misread your post?
If there is an issue with your display and its down to the component rather than coding, then best to start the topic in the V8 bugs section.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Thanks Martin i used != 32 and it worked like a humble dog.Now the option for common pin is there but when you disabled the common pin so that to use your old trick and activate the digit via the output port masking like you did on my old project of battery charger here it does not work that is what i meant.Maybe i did something wrong let me try it again and see.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Here it is with port masking it doesnot work but the good side of it is that the code size reduces, pliz take a look at the flowchat below.
Attachments
Sanitizer with port masking.fcfx
(39.72 KiB) Downloaded 159 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Glad its working like a humble dog for you.
Derrihj wrote:Now the option for common pin is there but when you disabled the common pin so that to use your old trick and activate the digit via the output port masking like you did on my old project of battery charger here it does not work
I don't believe that is what the common select is for.
What I believe is if common pin is set to No then anodes (common anode) or cathodes (common cathode ) of all 7seg's used will be connected to VCC or GND depending if common anode or cathode.
With common pin set to Yes, common of all 7seg displays are connected to separate pins to allow display multiplexing.
So you need to make sure common pin of all displays is set to Yesin order to use the component macros for your setup.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

I would like to use output icon with port masking like we did in the charger instead of using compenent macro inorder to reduce on code size.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Derrihj wrote:I would like to use output icon with port masking like we did in the charger instead of using compenent macro inorder to reduce on code size.
Then you need to delete all the 7seg components from the 2D panel
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Ok got you loud and clear Mr Martin.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Ok ive added custom characters, that is PE (people), on Start up display shows 0PE (0 people),now as an object comes close to the sensor, a 1 is added then display shows 1PE (1 person) and so on as the count comes to 10 and above it changes to say 10P, 20P, 99P then 100 without (P) upto 999.Now the code works well in flowcode but on Hardware it doesn't please take a look at my flowchat and help find the "BAD guy" in my code thanks allot.
Attachments
IMG_20200611_224240_358.jpg
(95.83 KiB) Downloaded 29 times
With Custom Characters.fcfx
(44.84 KiB) Downloaded 72 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: AUTOMATIC SANITIZER

Post by kersing »

It helps if you tell what part of the program doesn’t work.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

At first i used a decimal point to separate the zeros from numbers of people like 1.00, 2.00, 10.0, 99.0 and then 100 till 999.and the program works very well after Martin told me to use <>32,But now i wanted to replace the decimal point with characters like PE that is 1PE , 2PE, 10P, 99P and then 100 til 999, but when i load the code into the chip i get a funny display with no increasing numbers even with the object close to my IR-LED/Photodiode sensor pair.I get a funny display which is shown below.Remember my PE character is now sitting in place of the two zeros in case of (ones) and only a P in place of the one zero incase of (Tens) which should work exactly as in the first place with the zeros in place but it doesn't.
Attachments
IMG_20200611_224240_358.jpg
(95.83 KiB) Downloaded 23 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Ok i managed to work it out and now it's working with my characters after making seg1=1 instead of 0x73 ,seg2= 2
instead of 0x79 and a 2ms for each digit update interrupt having a total of around 165 flames/sec all together to minimize on the half lit led on my Characters as the reference 1 and 2 was reflecting allot on my characters so reducing the interrupt frequency to 165 helped reduce on the intensity of the half lit led. Using component macro takes more space BUT produces better display with totally zero half lit LEDs, so my conclusion is that if i want better display with totally zero half lit LEDs it's better to use the component macro for the digits common pin triggering and a spacious MCU but also the output port masking method helps when you are in a dangerous low mcu space "front line" haha. So using the output port masking all my code was able to fit it the 16f88.
Attachments
IMG_20200613_043429_627.jpg
IMG_20200613_043429_627.jpg (102.2 KiB) Viewed 6368 times
IMG_20200613_020741_113.jpg
IMG_20200613_020741_113.jpg (90.92 KiB) Viewed 6368 times
IMG_20200612_231813_825.jpg
IMG_20200612_231813_825.jpg (105.34 KiB) Viewed 6368 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Ok i have managed now to make my display look really beautiful with totally zero and i mean totally zero half lit LEDs even with port masking method, this is a great achievement for me as i don't have to use the component macro that take allot of my MCU space. I have managed to do this by clearing all port bits used just before the next digit to be displayed on each 7 seg Digit.I tell you i now have a nice and beautiful display that don't irretate the eyes.
Attachments
IMG_20200623_123625_543.jpg
IMG_20200623_123625_543.jpg (95.58 KiB) Viewed 6237 times
IMG_20200623_123825_876.jpg
IMG_20200623_123825_876.jpg (106.28 KiB) Viewed 6237 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Totally zero half lit LEDs only a reflection of a close camera.
Attachments
IMG_20200623_130526_231.jpg
IMG_20200623_130526_231.jpg (94.01 KiB) Viewed 6234 times
IMG_20200623_130806_398.jpg
IMG_20200623_130806_398.jpg (99.96 KiB) Viewed 6234 times
IMG_20200623_131015_337.jpg
IMG_20200623_131015_337.jpg (89.85 KiB) Viewed 6234 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Hi Derrihj,
That's great!
Well done.
Display is looking looking really good. :)
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: AUTOMATIC SANITIZER

Post by Derrihj »

Well Martin thats all your hadwork,you really did what you could to make me understand the 7seg which proved to be big headed to me in the first start, i really like you mr Martin, wish u could visit me in my country but the bad thing am not that rich to transport u down here.Keep the good work mr Martin. May GOD BLESS you richly.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: AUTOMATIC SANITIZER

Post by medelec35 »

Thank you Derrihj,
Very kind words indeed.
All very much appreciated.
Martin

Post Reply