Go to advanced search

by scotty101
Sat Sep 21, 2019 10:06 pm
Forum: Python
Topic: guizero: text in front, image in the background
Replies: 6
Views: 102

Re: guizero: text in front, image in the background

Currently not possible with "pure" guizero. It is however possible with a tkinter canvas widget. Since guizero is just a wrapper for tkinter, they can both be used side by side . Edit: I'm out of date, it is probably possible with the new drawing widget in guizero https://lawsie.github.io/guizero/d...
by scotty101
Thu Sep 19, 2019 2:47 pm
Forum: Python
Topic: Pynmea2 output Decimal Degrees. (Solved)
Replies: 20
Views: 207

Re: Pynmea2 output Decimal Degrees.

If you want to create a string, don't concatenate use the string formatting functions in python. myString = "{0} is a float converted to a string, {1} is a string".format(123.456,'A string') or the older fashioned method myString = "%f is a float converted to a string, %s is a string" % (123.456,'A ...
by scotty101
Thu Sep 19, 2019 11:29 am
Forum: Scratch
Topic: Raspberry Pi 4 and Scratch 2
Replies: 6
Views: 420

Re: Raspberry Pi 4 and Scratch 2

This isn't exclusively a Pi 4 issues. I experienced the same thing with a Pi3 at code club last weekend.

I was able to import a background from the background editor rather than via the normal import button. I haven't had a chance to figure out what the issue is however.
by scotty101
Thu Sep 19, 2019 11:09 am
Forum: Python
Topic: Pynmea2 output Decimal Degrees. (Solved)
Replies: 20
Views: 207

Re: Pynmea2 output Decimal Degrees.

Pynmea already processess the NMEA message from degrees/minutes/decimal minutes to decimal degrees.

It is done by the dm_to_sd function https://github.com/Knio/pynmea2/blob/bc ... ils.py#L29
by scotty101
Thu Sep 19, 2019 8:31 am
Forum: Other projects
Topic: Idea for an led strip shirt
Replies: 5
Views: 111

Re: Idea for an led strip shirt

The Pi is a bit large and power hungry for an application like this.

You should investigate something like the Adafruit "Flora" board which is specifically designed for "wearable" tech.
by scotty101
Thu Sep 19, 2019 8:27 am
Forum: Python
Topic: Send data through a single GPIO pin
Replies: 3
Views: 65

Re: Send data through a single GPIO pin

As it turns out, there is a pin that will exactly serve your needs. https://pinout.xyz/pinout/uart The Pi has a UART interface that will allow you to send bytes of data to another device. You can connect the TX pin of the Pi sending data to the RX pin of the receiving Pi. One caveat however is that ...
by scotty101
Thu Sep 19, 2019 8:21 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Elegant way to tap into the GPIO?
Replies: 3
Views: 132

Re: Elegant way to tap into the GPIO?

On many HATs/pHats the pin header is removable. This means that you can replace it with one with longer pins so that two hats can stack one on top of the other.
by scotty101
Wed Sep 18, 2019 2:07 pm
Forum: Advanced users
Topic: Moving the microSD Card between RPi Zero W and RPi Zero
Replies: 7
Views: 132

Re: Moving the microSD Card between RPi Zero W and RPi Zero

spaceman5 wrote:
Wed Sep 18, 2019 1:26 pm
The OS did not even notify about the Wi-Fi chip being missing?
It doesn't seem to care.
by scotty101
Wed Sep 18, 2019 1:20 pm
Forum: Advanced users
Topic: Moving the microSD Card between RPi Zero W and RPi Zero
Replies: 7
Views: 132

Re: Moving the microSD Card between RPi Zero W and RPi Zero

There shouldn't be any problems moving the card back and forward between the two.

I've used a Pi3B as a development platform before to build an application and then put the microSD card in to the Pi Zero for the real project.
by scotty101
Tue Sep 17, 2019 8:51 pm
Forum: Beginners
Topic: Starting with the pi
Replies: 3
Views: 75

Re: Starting with the pi

Have you had a look at the Raspberry Pi website's own material?

https://projects.raspberrypi.org/en/
by scotty101
Mon Sep 16, 2019 4:02 pm
Forum: Networking and servers
Topic: Migrate wordpress to hosting
Replies: 3
Views: 105

Re: Migrate wordpress to hosting

Not really a Pi specific question.

There are lots of google results explaining how to do this, including https://www.wpbeginner.com/wp-tutorials ... -downtime/
by scotty101
Fri Sep 13, 2019 11:47 am
Forum: General discussion
Topic: correct use of serial port
Replies: 8
Views: 368

Re: correct use of serial port

Worth pointing out that the TX/RX pins cannot be connected directly to RS-232. RS-232 has a higher voltage than the Pi can handle. You need a converter like a MAX3232 to convert RS232 to 3.3V TTL.

EDIT: B.Goode beat me to it.
by scotty101
Thu Sep 12, 2019 12:07 pm
Forum: Python
Topic: Tkinter GUI saving textfile
Replies: 4
Views: 169

Re: Tkinter GUI saving textfile

Function ADClogall doesn't return anything. Try def ADClogall(): adc1 = ADCPi(0x68,0x69,12) adc2 = ADCPi(0x6A,0x6B,12) all8chn = [adc1.read_voltage(1), adc1.read_voltage(2), adc1.read_voltage(3), adc1.read_voltage(4), adc1.read_voltage(5), adc1.read_voltage(6), adc1.read_voltage(7), adc1.read_voltag...
by scotty101
Wed Sep 11, 2019 11:08 am
Forum: HATs and other add-ons
Topic: Displayotron 3000 - toggle backlight on/off with joystick
Replies: 4
Views: 125

Re: Displayotron 3000 - toggle backlight on/off with joystick

The problem is that the code library for the displayotron, does not allow you to read the current status of the backlight. The line if backlight.off(): Will turn the LED off and execute the code inside the if branch if backlight.off() returns true but the off function doesn't return anything so the ...
by scotty101
Tue Sep 10, 2019 11:13 am
Forum: Beginners
Topic: read variable from .txt file
Replies: 4
Views: 103

Re: read variable from .txt file

Same thing really but in python instead array1 = [] array2 = [] with open('data.txt') as data: for line in data.readlines(): a,b = line.strip().split(',') array1.append(a) array2.append(b) print("Array 1: {}".format(array1)) print("Array 2: {}".format(array2)) This outputs Array 1: ['1', '2', '4', '...
by scotty101
Mon Sep 09, 2019 8:31 am
Forum: General discussion
Topic: Only 1 motor is working on two motor robot
Replies: 7
Views: 273

Re: Only 1 motor is working on two motor robot

wiser wrote:
Mon Sep 09, 2019 1:33 am
Ok. Do you know any programs to make a circuit diagram with the raspberry pi?
https://fritzing.org/home/
by scotty101
Fri Sep 06, 2019 10:52 am
Forum: Python
Topic: Tkinter GUI saving textfile
Replies: 4
Views: 169

Re: Tkinter GUI saving textfile

As you haven't provided a complete example of your code, I've had to invent a lot of stuff to guess what you are trying to do in order to produce this example for you. from tkinter import * import tkinter as tk import time import datetime def writetotxtfile(texttowrite,filename): file = open(str(fil...
by scotty101
Fri Sep 06, 2019 8:30 am
Forum: Python
Topic: guizero - question, in more ways than one
Replies: 4
Views: 156

Re: guizero - question, in more ways than one

Also, check if this code works for you. from guizero import App, PushButton, Text def button_pressed(): name = app.question("Hello", "What's your name?") # if Cancel is pressed None is return # so check a name was entered if name is not None: hello.value = "Hello " + name app = App() button = PushBu...
by scotty101
Fri Sep 06, 2019 8:26 am
Forum: Python
Topic: guizero - question, in more ways than one
Replies: 4
Views: 156

Re: guizero - question, in more ways than one

Guizero also stores a version number inside the source code. To see it type the following commands in a python interpreter

Code: Select all

import guizero
guizero.__version__
For me this reports

Code: Select all

'1.0.0'
by scotty101
Wed Sep 04, 2019 9:52 pm
Forum: Other projects
Topic: Printing bathroom passes
Replies: 1
Views: 113

Re: Printing bathroom passes

Have you been able to print anything from the printer yet? Adafruit are very helpful and they have produced a python library for controlling the thermal printer which you can download and use. There is an example script on there which you should be able to modify to print a simple date/time stamp an...
by scotty101
Wed Sep 04, 2019 12:27 pm
Forum: Beginners
Topic: Connecting existing Doorbell (AC door bell with bell switch ) to raspberry pi 3 GPIO
Replies: 16
Views: 338

Re: Connecting existing Doorbell (AC door bell with bell switch ) to raspberry pi 3 GPIO

Standard "AC voltages can be dangerous, only work with them if you are qualified" warning. A relay would likely be the most suitable. You'll need to find one that works with the voltages output by the doorbell circuit. The relay's coil should be connected in parallel with the doorbell and you can us...
by scotty101
Wed Sep 04, 2019 8:05 am
Forum: Automation, sensing and robotics
Topic: DC position control with pid
Replies: 3
Views: 160

Re: DC position control with pid

Yes that's the process. There are entire tutorials out there for tuning PID controllers. Start with just a P term and see how the system responds. Worry about the rest later if the system shows instability or is slow to respond. You will need to take in to account the fact that the motor's response ...
by scotty101
Tue Sep 03, 2019 3:05 pm
Forum: Graphics, sound and multimedia
Topic: Tips to Play music while door is open
Replies: 1
Views: 95

Re: Tips to Play music while door is open

Nothing specifically difficult about that. You can get magnetic switches like those used in security systems to detect whether a door is open or closed. These act like normal switches and can be directly connected to the raspberry pi's GPIO pins. The GPIOZero recipes have a simple "music box" exampl...
by scotty101
Tue Sep 03, 2019 1:29 pm
Forum: Automation, sensing and robotics
Topic: DC position control with pid
Replies: 3
Views: 160

Re: DC position control with pid

There will be two components that you need to control How far away from the correct position am I? Which direction do I need to move to correct the error? If your desired angle is 50 and your current position is 70 then your error is -20. The minus indicates that you need to move anticlockwise and t...
by scotty101
Tue Sep 03, 2019 11:31 am
Forum: Graphics, sound and multimedia
Topic: Order display project
Replies: 4
Views: 208

Re: Order display project

i have seen people suggesting using excel and publish as a webpage, which works but there will still be human input to manually separate the orders. hopefully there is a solution where the clerk can input all orders into one page. A spreadsheet would not be the right solution for this at all but sa...

Go to advanced search