Go to advanced search

by Daveolw1
Mon Jun 17, 2019 9:42 am
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Function going through twice

Have checked wiring, originally I used internal pull ups but got spurious events so disabled them and have 10k connected to the 3.3 volts. I used a different button which was working ok with other code and the same happened, it went through twice, I still think it is something to do with the open fi...
by Daveolw1
Sun Jun 16, 2019 8:11 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

Can not see it is switch bounce, as stated in my first post I suspected that and increased it to 1000.
by Daveolw1
Sun Jun 16, 2019 6:06 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

Thanks for the information, I tried as you suggested and it only goes through once so this prove it is a true GPIO input.

Thanks David
by Daveolw1
Sun Jun 16, 2019 12:37 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

I gave my function a different name and just called that from the callback function but the result was the same it went through twice.
by Daveolw1
Sat Jun 15, 2019 5:43 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

Yes, I have already got a lot of print statements in it but I removed them before posting so the code could be read easier. Below code and output, I have a workaround at the moment with the If statement " if not digit5_value == 0:" but have commented out the line at the bottom " #digit5_value = 0" t...
by Daveolw1
Sat Jun 15, 2019 4:01 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

So when I remove those two sections of code, does it only go through once, with either of them in it goes through twice?
by Daveolw1
Sat Jun 15, 2019 3:30 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Re: Funtion going through twice

Thanks for the replies. I have worked out it is the "open file/For" section of code that is causing it, if I remove this part of code it only goes through the once. f = open("/media/pi/PI_STORAGE/play_list/all_play_list.txt", 'w') for item in playlist_files: print('item = ', item) f.write(item + ','...
by Daveolw1
Fri Jun 14, 2019 6:36 pm
Forum: Python
Topic: Function going through twice
Replies: 18
Views: 939

Function going through twice

Why does it go through this function twice, I thought it was button bounce but increased the value to 1000 but it still happened. I then added the sleep 50 at the end and it waits there and then goes through again. There is nothing in the function that refers to any other part of the programme it is...
by Daveolw1
Sat Jun 08, 2019 7:05 pm
Forum: General discussion
Topic: Unable to connect to a different wifi
Replies: 6
Views: 222

Re: Unable to connect to a different wifi

That's what I have been doing, but it does nothing, just found an article about editing the "wpa_supplicant.conf" file, in that it has:- network={ ssid="belkin54g" key_mgmt=NONE wep_key0="mypassword" } network={ ssid="TP-Link_EA2E" psk="mypassword" key_mgmt=WPA-PSK } The "TP-Link_EA2E" is the origin...
by Daveolw1
Sat Jun 08, 2019 6:15 pm
Forum: General discussion
Topic: Unable to connect to a different wifi
Replies: 6
Views: 222

Re: Unable to connect to a different wifi

Where are these then " setup a static IP or a fallback IP in the Pi ? In the Network Preferences it has configure SSID and I select the wireless belkin54g, then there is a box automatically configure empty options, with this ticked and click apply nothing happens. With the box unticked what do I put...
by Daveolw1
Sat Jun 08, 2019 1:07 pm
Forum: General discussion
Topic: Unable to connect to a different wifi
Replies: 6
Views: 222

Unable to connect to a different wifi

Installed raspberry 3 + and it connected to the wifi of my router which was in the same room, have now moved the raspberry 3 + to another room where the router wifi signal is poor but I have another wifi unit there. It connect to the router wifi but gave the IP address of my Internet line and not th...
by Daveolw1
Fri Jun 07, 2019 6:49 am
Forum: Python
Topic: Using button to display text in tKinter text wiget
Replies: 4
Views: 249

Re: Using button to display text in tKinter text wiget

Thanks for the reply, that article will be very helpful.
David
by Daveolw1
Thu Jun 06, 2019 6:27 pm
Forum: Python
Topic: Using button to display text in tKinter text wiget
Replies: 4
Views: 249

Re: Using button to display text in tKinter text wiget

Thanks for the reply, actually I did have the "root.mainloop" there it was the last line of the code but for some reason it got lost in the copy and paste. I have great difficulty finding tutorials for tkinter and python, a lot of example code not working. To give one simple example a lot of the exa...
by Daveolw1
Wed Jun 05, 2019 5:02 pm
Forum: Python
Topic: Using button to display text in tKinter text wiget
Replies: 4
Views: 249

Using button to display text in tKinter text wiget

Trying to use a button to add text to the graphic screen using a tKinter text wiget. The line " T.insert("1.0", line1)" fails to work, if I remove the "#" from the two lines:- #screen_display_var = 1 #run_program = False it works just running through that piece of code, but not from the button It do...
by Daveolw1
Thu May 30, 2019 6:27 pm
Forum: Python
Topic: Using 7 segment display inside Python code
Replies: 8
Views: 1332

Re: Using 7 segment display inside Python code

Thanks for that information, yes I think that is where I have gone wrong. It is Python3 and I used PIP, and Python.
Will have to start all over again. I missed where it said to change Python to Python3 and PIP to PIP3.

Thanks
David
by Daveolw1
Thu May 30, 2019 2:21 pm
Forum: Python
Topic: Using 7 segment display inside Python code
Replies: 8
Views: 1332

Re: Using 7 segment display inside Python code

No name is "test7seg.py"
by Daveolw1
Thu May 30, 2019 6:36 am
Forum: Python
Topic: Using 7 segment display inside Python code
Replies: 8
Views: 1332

Re: Using 7 segment display inside Python code

Yes I followed those instructions and did the checks to confirm it had everything installed.
Yes it is Python as stated in my post.
by Daveolw1
Wed May 29, 2019 8:39 pm
Forum: Python
Topic: Using 7 segment display inside Python code
Replies: 8
Views: 1332

Using 7 segment display inside Python code

Using a 8 digit 7 segment Max7219 display module and want to access it fro my python code by pressing buttons to change the display characters. It works when running from terminal SUDO, but from python I get an error, "from luma.led_matrix.device import max7219 ImportError: No module named 'luma'" I...
by Daveolw1
Sat May 18, 2019 9:58 am
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 322

Re: tkinter Text Widget putting "{}" around text I insert

Can you explain how this works # Note use of tilde to save typing :-) with open("~/Documents/song1.txt") as f: f1 = f.read() f1 = f1.strip() # Take out CR / LF from the text read from file T.insert("1.0", f1) If the CR/LF have been stripped out how does the insert know what is a line? I assumed "f1"...
by Daveolw1
Sat May 18, 2019 9:49 am
Forum: Python
Topic: Editing in Python 3.5.3 Shell
Replies: 3
Views: 214

Re: Editing in Python 3.5.3 Shell

Thanks for information.

David
by Daveolw1
Fri May 17, 2019 7:51 pm
Forum: Python
Topic: Editing in Python 3.5.3 Shell
Replies: 3
Views: 214

Editing in Python 3.5.3 Shell

Editing in Python 3.5.3 Shell why does the "undo", "copy", "Paste" and keyboard "delete", "back space" not work?
If you make a mistake I cannot see how to go back.
by Daveolw1
Thu May 16, 2019 8:10 pm
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 322

Re: tkinter Text Widget putting "{}" around text I insert

Thanks for the replies. Andyroo, I copied your code but it brought up an error 2 file not found but replacing the "~" with /home/pi it worked fine. scotty101 I put the "x" in place of "f1" and it worked but the lines were in reverse order, and 2 lines were in one line. Thanks for your help I realise...
by Daveolw1
Thu May 16, 2019 10:40 am
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 322

tkinter Text Widget putting "{}" around text I insert

Using Raspberry pi 3 Python and tkinter GUI and reading from file and inserting in Text Widget, but the text is wrapped by curly brackets and it also shows the text 4 times. My code:- from tkinter import * root = Tk() T = Text(root, height=40, width=100) T.pack() f = open('/home/pi/Documents/song1.t...

Go to advanced search