Go to advanced search

by onlinegill
Sat Nov 17, 2018 12:43 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

poursmall = tk.PhotoImage(file="textures/970A5BD3-7EAB-4789-AFDC-1D6B66425D5F.gif") small_button = tk.Button(button_frame, image=poursmall, command=pour_small) # etc # in the pour_small function you would do # medium_button.configure(image=mediumpour_grey) # etc, and reverse these changes when your...
by onlinegill
Mon Nov 12, 2018 4:01 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Its working great !!!
is there anyway i can call pour_small buttons etc from html page with php ? so it will easy to design.
i am able to turn on led with php but don’t how to call function while .py script is running.
by onlinegill
Thu Nov 08, 2018 5:05 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy, i made it working by adding tk codes all the way down and removing pause. so far i am using hdmi monitor and buttons are working with mouse. i am planing to use small touch screen which could be touched by finger without showing mouse pointer. may be 3.5 or 7 inch what you think which one wou...
by onlinegill
Tue Nov 06, 2018 10:04 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

It depends crucially on what kind of touchscreen you are using. But if it behaves like a normal display and mouse click then you could use tkinter and make the screen buttons call the same functions you called with the gpio buttons. Along the lines of: import tkinter as tk ... root = tk.Tk() root.w...
by onlinegill
Tue Nov 06, 2018 1:47 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

That's very odd. It sounds like the start_pour function and count_pulse function are conflicting in some way over setting the global variables. Things like that are a reason not to use globals but that's rather hard with gpiozero! Apart from doing without the timeout the only way I can think to fix...
by onlinegill
Mon Oct 22, 2018 3:02 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

That function looks ok. what do you mean by 'when I blow air in flow meter'? In the code the clean valve opens *after* the solenoid valve has closed. There is no facility to manually blow air. When i press pour Button(18) solenoid LED(17) turned on and wait for flow meter Button(23) to measure amou...
by onlinegill
Sun Oct 21, 2018 11:26 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Ah, well done spotting and removing the unneeded MEASURE_COUNT. You probably also spotted that the timeout and turn the solenoid off should go at the end of the start_pour just as it was in the function you deleted. I'm not really sure what your video shows as I don't know what the button, or the t...
by onlinegill
Sun Oct 21, 2018 2:43 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy, i deleted 37-43 which were following codes. def start_pour(): global count solenoid.on() count = 0 sleep(TIME_OUT) solenoid.off() i played with codes and adjusted pins as as there was no pin #14 etc or may be could not find in dark :? . I have following two issues now 1 All the buttons are wo...
by onlinegill
Sat Oct 20, 2018 8:01 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Well, as I said above: read the error message (only the last three or four lines generally make any sense, but don't stop reading it until you understand what caused the error) Then look at your code. You will immediately see that start_pour is redefined with an incorrect version after the correct ...
by onlinegill
Sat Oct 20, 2018 7:33 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy, I used code the one you provided which are in my this post below. how can i make these codes work which are in my current post ? when i click on button it does not turn on solenoid and right way i can see following output in terminal window. pi@raspberrypi:~/wine $ sudo python padydy3.py Trac...
by onlinegill
Sat Oct 20, 2018 5:14 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

paddyg wrote:
Sat Oct 20, 2018 6:41 am
hi sorry about that the second version of the fuction is incorrect and should be deleted. I tried to do that but hard on phone. I will re.edit prev post
Hi Paddy,
No problem. i will wait for update.
Thank you
by onlinegill
Fri Oct 19, 2018 9:25 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Hi, your earlier post with the error message pointed to what the issue might be: that line turning the solenoid off should have been indented because it came just after the if line ending with a colon. However there were other inconsistencies that would have stopped the code working - you had the s...
by onlinegill
Fri Oct 19, 2018 2:07 am
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

I don't mind at all. Just to further confuse you... It would be possible to have just one Button() and press it for different length of time to get different amounts. Along the lines of import time ... SMALL_TM = 0.5 BIG_TM = 3.0 ... def start_timer(): global start_tm start_tm = time.time() def sta...
by onlinegill
Tue Oct 16, 2018 11:10 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy, i would like to stick with 3 buttons because it will be user friendly also in future i would like to use touch displays to set temperature, add more bottles. i tried to modify previous codes you posted but i am getting following error. i know there could be more errors. could you please check...
by onlinegill
Tue Oct 16, 2018 2:47 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy,
i hope you dont mind as i am asking so many questions but its my desire to complete it as soon as possible.
i will rewire everything such as buttons,leds (which will be acting as solenoid valves) and let you know if i dont understand something. i am sure i will be bad in coding side.
by onlinegill
Tue Oct 16, 2018 2:18 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Paddy,
i am little confuse. which button will pour medium and full pour ?
by onlinegill
Mon Oct 15, 2018 11:37 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Hi, I removed spaces and its working fine. thank you so much!! can i add more buttons ? like if i want to add more two pours ? first button with 30 pulses. 2nd with 60 pulses. 3rd with full glass. also turn solenoid.off() after couple seconds ( like 50 ) just in case it does not pour ( empty bottle ...
by onlinegill
Mon Oct 15, 2018 11:24 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

well you might find a better example among all the recipes in the docs but I would do something along the lines of this (untested), using LED as generic output and Button for input, may be more appropriate ones (i.e. digitalInputDevice, digitalOutputDevice) from gpiozero import Button, LED from sig...
by onlinegill
Mon Oct 15, 2018 8:27 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

Re: stop solenoid valve with flow meter pulse

Hi, I would use the https://gpiozero.readthedocs.io/en/stable/recipes.html module it breaks each 'action' out into a function like you've done with your pulse meter. Have a look at that and post again if you get stuck or something doesn't make sense. Paddy Hi i was reading that examples and i made ...
by onlinegill
Mon Oct 15, 2018 8:10 pm
Forum: Python
Topic: stop solenoid valve with flow meter pulse
Replies: 62
Views: 10245

stop solenoid valve with flow meter pulse

Hi, i am using fowling codes ( found on internet ) to read flow meter pulses. what i would like to do that when flow meter read 24 pulses it will stop solenoid valve on pin 17. and keep running in loop ( reset count / pulses push button to turn on solenoid valve (to run pour with food grade gas ) li...

Go to advanced search