Go to advanced search

by scotty101
Thu Feb 27, 2020 8:53 am
Forum: Python
Topic: How can I reload the content of a tkinter window?
Replies: 2
Views: 57

Re: How can I reload the content of a tkinter window?

I answered a topic yesterday where the OP was doing something very similar. Have a look
viewtopic.php?f=32&t=266243

With tkinter, you use the .after method to schedule something to happen periodically which will then update the widgets of a tkinter window.
by scotty101
Wed Feb 26, 2020 9:42 am
Forum: Python
Topic: "invalid command name" error using tkinter
Replies: 10
Views: 195

Re: just wondering

Can you try running your program from the command line rather than from Thonny? I have heard that Thonny and tkinter work in strange ways sometimes.

The error looks like something from the tcl interpreter that sits underneath tkinter rather than a python error.
by scotty101
Wed Feb 26, 2020 9:07 am
Forum: Python
Topic: "invalid command name" error using tkinter
Replies: 10
Views: 195

Re: just wondering

I managed to get your code working with a few modifications. Does this work for you? #!/usr/bin/python3 import time import tkinter as tk def tick(time0=''): time1 = time.strftime(' %I:%M:%S %p \n %A %d %S') if time1 != time0: time0 = time1 clock.config(text=time1) clock.after(1000, tick) root = tk.T...
by scotty101
Tue Feb 25, 2020 5:07 pm
Forum: Beginners
Topic: Please help me understand the clock pin of Serial RS232 communication
Replies: 27
Views: 405

Re: Please help me understand the clock pin of Serial RS232 communication

Do you have the "input tool" which they mention?
This shows a d-sub 9 (and RS232) connector rather than the other connector with the clock signal on it.
by scotty101
Tue Feb 25, 2020 3:39 pm
Forum: Beginners
Topic: Please help me understand the clock pin of Serial RS232 communication
Replies: 27
Views: 405

Re: Please help me understand the clock pin of Serial RS232 communication

Sure.

With RS232, there is NO clock pin. The data is sent asynchronously and doesn't use a clock.

Seems like you need more information from the manufacturer of this device.
by scotty101
Mon Feb 24, 2020 5:18 pm
Forum: Python
Topic: Straight-8 LEDs - Knight Rider style
Replies: 7
Views: 179

Re: Straight-8 LEDs - Knight Rider style

Have a look at gpiozero and it's ledboard recipe https://gpiozero.readthedocs.io/en/stable/recipes.html#ledboard You can turn each LED on/off in turn rapidly to replicate the KITT style "scanner" Someone has already done something like this https://gist.github.com/erikvanzijst/df1d182e47e53d519f4457...
by scotty101
Tue Feb 18, 2020 10:26 am
Forum: General discussion
Topic: How to call function after gpio input is high in tkinter?
Replies: 6
Views: 240

Re: How to call function after gpio input is high in tkinter?

Then you callback needs to call "win.change".
by scotty101
Tue Feb 18, 2020 7:40 am
Forum: General discussion
Topic: How to call function after gpio input is high in tkinter?
Replies: 6
Views: 240

Re: How to call function after gpio input is high in tkinter?

Do you still want the slideshow to change automatically after a period of time? I'll give you a clue as to why what you have isn't working. You've registered a GPIO callback with something called "Slide.change()". You don't have an object called change. Try moving that line below the "win = SlideSho...
by scotty101
Mon Feb 17, 2020 3:26 pm
Forum: General discussion
Topic: DIY RC Transmitter with Pi
Replies: 1
Views: 83

Re: DIY RC Transmitter with Pi

Do you have the transmitter or receiver already?

If you have the receiver, do you hope to be able to send signals to it from the Pi?
by scotty101
Mon Feb 17, 2020 10:11 am
Forum: Python
Topic: ZipFile in python
Replies: 6
Views: 181

Re: ZipFile in python

How about extractall?

Code: Select all

import zipfile

with zipfile.ZipFile("example.zip",'r') as zipObj:
    zipObj.extractall()
by scotty101
Mon Feb 17, 2020 9:17 am
Forum: Python
Topic: ZipFile in python
Replies: 6
Views: 181

Re: ZipFile in python

Zipfile's extract method will do what you are looking for.

It extracts the specified file to the working directory (or you can specify a new directory)

Do you have an example of code using the extract method that doesn't work? Maybe we can help you debug that.
by scotty101
Fri Feb 14, 2020 11:55 am
Forum: Beginners
Topic: Connect a momentary button using raspberry.
Replies: 6
Views: 163

Re: Connect a momentary button using raspberry.

NO - should be some GPIO? COM - should be GND? Correct. NO is normally open which mean that the contacts will be closed when the button is pressed NC means normally closed which is where the contacts are opened when the button is pressed. No resistor needed but I'd suggest enabling the pull up on t...
by scotty101
Wed Feb 12, 2020 2:03 pm
Forum: Troubleshooting
Topic: "module not installing" with raspberry pi 4
Replies: 2
Views: 77

Re: "module not installing" with raspberry pi 4

What command/action did you use to install the module? You need to do more than just download the zip. Also note the following from the Picotech website (https://www.picotech.com/downloads/linux) These are beta drivers. All driver features are available, but they may not work in all cases. This rele...
by scotty101
Wed Feb 12, 2020 8:18 am
Forum: General discussion
Topic: Circuits in space
Replies: 21
Views: 716

Re: Circuits in space

Hello there. What's the name of the project (the payload, not your code)? I am sorry for not answering, but I believe this is not the Astro-Pi program, it is a new program called COMPUTER by the University of Alabama at Huntsville, but you probably won't find any information on it. Then you'll prob...
by scotty101
Tue Feb 11, 2020 8:43 am
Forum: Python
Topic: Tap into browser elements - python3
Replies: 2
Views: 114

Re: Tap into browser elements - python3

Not a simple task.
If it is possible, you'd likely have to write a plugin for the browser.

Might be worth asking on one of the Chromium message boards to see if they can help. More their area of expertise than a raspberry pi forum.
by scotty101
Mon Feb 10, 2020 7:12 pm
Forum: Troubleshooting
Topic: Connecting a USB device by GND, VCC, RX,TX
Replies: 1
Views: 56

Re: Connecting a USB device by GND, VCC, RX,TX

The image you have shared appears to just be a USB cable without a second end.

To use a serial port you need a cable that has a USB to Serial adaptor connected to it.

Something like this
https://shop.pimoroni.com/products/usb- ... sole-cable
by scotty101
Mon Feb 10, 2020 11:47 am
Forum: Staffroom, classroom and projects
Topic: Project school motorcycle
Replies: 3
Views: 210

Re: Project school motorcycle

I need help with the programming. Which aspects of the programming? Is it the GSM module and sending an SMS part? The GPS part? The recording video? The detection of an accident? The webserver part? There are many different parts of your project and you haven't said which part you are stuck on. Tac...
by scotty101
Fri Feb 07, 2020 10:55 am
Forum: Beginners
Topic: Wiring inductive sensors in series
Replies: 38
Views: 767

Re: Wiring inductive sensors in series

Yes you'll need a seperate power supply to drive these. 12V DC should be sufficient. As for interfacing to the Pi, I'd recommend an Opto-Isolator for each sensor. Opto-isolators are basically a light and a light sensor in the same closed box. When the input is active (inductive sensor detects someth...
by scotty101
Fri Feb 07, 2020 10:49 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using gyroscope data to calculate rotation matrix
Replies: 1
Views: 121

Re: Using gyroscope data to calculate rotation matrix

RTIMU is the library used by the SenseHAT.
https://github.com/RPi-Distro/RTIMULib

There are a large number of academic papers out there explaining this process but I've never understood it either.
by scotty101
Fri Feb 07, 2020 10:43 am
Forum: Advanced users
Topic: Raspberry Pi 3 and GSM Module - Phone Number Verification
Replies: 8
Views: 260

Re: Raspberry Pi 3 and GSM Module - Phone Number Verification

You can call a number using the ATD command and the device will respond with either "OK" or one of a few error messages such as "NO ANSWER". Thanks, but if I call a number using the ATD command, the destination rings, right? Correct. The GSM module has no idea what a correct number looks like, that...
by scotty101
Thu Feb 06, 2020 5:31 pm
Forum: Advanced users
Topic: Raspberry Pi 3 and GSM Module - Phone Number Verification
Replies: 8
Views: 260

Re: Raspberry Pi 3 and GSM Module - Phone Number Verification

There isn't a command to tell you whether the phone number exists. You can call a number using the ATD command and the device will respond with either "OK" or one of a few error messages such as "NO ANSWER". If you dial an invalid number, one of these error messages will probably be output by the GS...
by scotty101
Thu Feb 06, 2020 5:04 pm
Forum: Beginners
Topic: Fitting a fan without using GPIO?
Replies: 20
Views: 426

Re: Fitting a fan without using GPIO?

Can I use any of those 4 pins at J14 PoE, behind the Ethernet port? No. Thanks for your reply. A simple answer. However, it now poses another question in my mind: Why not? Are these input or output jumpers? I'm tempted to put a tester on them - unless there is an official schematic for the Pi4? Che...
by scotty101
Tue Feb 04, 2020 6:00 pm
Forum: Python
Topic: Simplifying my code
Replies: 1
Views: 119

Re: Simplifying my code

Have a look at my post here https://www.raspberrypi.org/forums/viewtopic.php?f=67&t=263803#p1605458 The code shows how to create a selection of tkinter widgets (inclucing checkboxes) to control GPIO pins. It would be very easy to modify to only show the few GPIO pins that you are interested in. The ...
by scotty101
Tue Feb 04, 2020 10:15 am
Forum: Beginners
Topic: How do I control a linear actuator?
Replies: 7
Views: 162

Re: How do I control a linear actuator?

Some form of motor controller which is suitable for the linear actuator's motor.

Impossible to give more specific suggestions without any information about what current the linear actuator requires.
by scotty101
Mon Feb 03, 2020 8:07 am
Forum: Graphics programming
Topic: control tkinter gui using gpio rpi
Replies: 1
Views: 419

Re: control tkinter gui using gpio rpi

So I want to make a program using the gpio pins of the rpi. is it possible to control the gui using a button connected to the gpio? Is it possible? Yes it is. Below is some code I wrote ages ago to monitor/control GPIO pins using a tkinter gui. Probably still works. import sys if(sys.version_info[0...

Go to advanced search