Go to advanced search

by scotty101
Tue Sep 17, 2019 8:51 pm
Forum: Beginners
Topic: Starting with the pi
Replies: 3
Views: 64

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: 79

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: 265

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: 154

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: 105

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: 101

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: 256

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: 154

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: 152

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: 152

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: 106

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: 328

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: 153

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: 91

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: 153

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: 196

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...
by scotty101
Tue Sep 03, 2019 8:39 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reboot I2C device?
Replies: 3
Views: 132

Re: Reboot I2C device?

jfody80 wrote:
Mon Sep 02, 2019 6:16 pm
Can I send a command from my python script which is controlling the device to cycle pin 1 if I detect stale data?
No. Pin 1 is 3.3v and is not controllable via software.
You could power the device from 3.3v but also have a transistor in the circuit which can be controlled from another GPIO pin.
by scotty101
Mon Sep 02, 2019 3:40 pm
Forum: Python
Topic: MP3 player
Replies: 12
Views: 402

Re: MP3 player

All intended to be constructive and in the spirit that code is read more often than it is written E8 = tk.Text(self.master, height=1, width=3, font = 40, padx = 10, pady = 10) E8.place(x=595, y=16) E8.insert(INSERT,volume) I can infer from this that E8 is for the volume control but it isn't obvious ...
by scotty101
Mon Sep 02, 2019 1:16 pm
Forum: Python
Topic: MP3 player
Replies: 12
Views: 402

Re: MP3 player

Would you be open to some constructive feedback on your code?
There are a few things that could help improve your code and make it more "pythonic"
by scotty101
Mon Sep 02, 2019 10:36 am
Forum: General discussion
Topic: Recommendation for IMU
Replies: 2
Views: 106

Re: Recommendation for IMU

Would you consider one with a magnetometer to give you the yaw angle?
Gyro/Accelerometer solutions alone won't give you an accurate long term yaw reading.
by scotty101
Tue Aug 27, 2019 8:46 pm
Forum: Troubleshooting
Topic: Scale stops working when running 5v pump
Replies: 9
Views: 206

Re: Scale stops working when running 5v pump

Are the pumps being supplied from a suitably powerful supply?
Might be that they run fine when dry but require more power when actually pumping.
Measure the current with a multimeter and check what the datasheet for the pump and power supply.
by scotty101
Mon Aug 26, 2019 9:06 am
Forum: Troubleshooting
Topic: Com port not useable in software
Replies: 16
Views: 438

Re: Com port not useable in software

My guess is that the software is expecting the serial port name to be in a different format. You could try to ask the developers what serial port names are accepted and then either... 1. Create a symbolic link from the current port to a name that works 2. Use a udev rule to have the USB driver give ...
by scotty101
Sun Aug 25, 2019 4:16 pm
Forum: Python
Topic: Toggleing Tkinter Buttons between Red and Green for Visual Feedback
Replies: 3
Views: 149

Re: Toggleing Tkinter Buttons between Red and Green for Visual Feedback

Thankyou! Don't know why having "Global" in or out of the function makes a difference but it works perfect. If you use global outside of a function, it basically does nothing. You are telling the global namespace to use a variable from the global namespace (which it already would do). When you use ...
by scotty101
Tue Aug 20, 2019 12:11 pm
Forum: Python
Topic: Send email with different buttons how
Replies: 3
Views: 206

Re: Send email with different buttons how

You only have one "count". I suspect you need to have a "hotCount" and a "coldCount" variable in order to count how many times each button is pressed rather than how many times either of them have been pressed.
by scotty101
Fri Aug 16, 2019 10:32 pm
Forum: Gaming
Topic: Simulated novel
Replies: 7
Views: 2095

Re: Simulated novel

A webpage sounds ideal for this.

The code club website has a "linked room" exercise that you could adapt for your purposes.

https://projects.raspberrypi.org/en/pro ... nked-rooms

Go to advanced search