Go to advanced search

by scotty101
Fri Dec 13, 2019 8:33 am
Forum: C/C++
Topic: platform independent c++ string length
Replies: 6
Views: 164

Re: platform independent c++ string length

Seems more like a question for stack overflow than a Raspberry Pi forum.
by scotty101
Thu Dec 12, 2019 4:26 pm
Forum: General programming discussion
Topic: package code?
Replies: 4
Views: 146

Re: package code?

There is
https://www.pyinstaller.org/

Which can build executables for windows/linux/mac etc.
by scotty101
Thu Dec 12, 2019 3:43 pm
Forum: General discussion
Topic: Unable to locate matlab-rpi
Replies: 2
Views: 59

Re: Unable to locate matlab-rpi

Correct.

The official docs state that only Jessie and Stretch are supported.
Also only the 2B and 3B models are supported.

https://uk.mathworks.com/help/supportpk ... nline.html
by scotty101
Thu Dec 05, 2019 4:51 pm
Forum: Python
Topic: Python, I2C, Tkinter
Replies: 1
Views: 79

Re: Python, I2C, Tkinter

First problem - the dev problem - your list of devices is stored in a global variable called 'devices' not 'dev'. The line should be for dev in devices: Second problem, I can't help with, there is nothing immediately obviously wrong from a python perspective. I'd try these commands at an interactive...
by scotty101
Wed Dec 04, 2019 4:50 pm
Forum: General discussion
Topic: 1-Wire Interface
Replies: 3
Views: 162

Re: 1-Wire Interface

Can you be more specific about what type of 1-wire devices? Device numbers for example.

Many 1-wire devices are supported on the raspberry pi with the most common probably being the DS18B20 temperature sensor.

They are generally connected directly to the GPIO pins rather than via USB.
by scotty101
Wed Dec 04, 2019 1:56 pm
Forum: Python
Topic: Python, Tkinter
Replies: 7
Views: 208

Re: Python, Tkinter

Well its up to you to decide whether it works or not. Without understanding the longer term goals of your project it is difficult to advise whether your code will be suitable for this or whether there is a better way. There is something unusual in your code for dev in range(1): This creates a loop t...
by scotty101
Wed Dec 04, 2019 11:58 am
Forum: Official Foundation Display
Topic: 7 inch display with no bezel
Replies: 2
Views: 129

Re: 7 inch display with no bezel

If by "operates identically" you mean connects via the DSI port, there is no alternative.
by scotty101
Wed Dec 04, 2019 9:31 am
Forum: Python
Topic: Python, Tkinter
Replies: 7
Views: 208

Re: Python, Tkinter

I don't see this behaviour... I've modified the code to add a button which will output the state of the radio buttons. #from smbus2 import SMBus, i2c_msg from tkinter import * from tkinter.ttk import * from tkinter import messagebox ##channel = 1 ##i2c = SMBus(channel) ##with SMBus(1) as bus: ## dev...
by scotty101
Tue Dec 03, 2019 9:50 pm
Forum: Python
Topic: Python, Tkinter
Replies: 7
Views: 208

Re: Python, Tkinter

I've made a few changes to your code (including commenting out the SMBus stuff since I don't have any I2C devices handy) The important change is around creating a new IntVar for each I2C device which is then stored in a list "device_vars". Performing a .get() on each item in the "device_vars" list w...
by scotty101
Tue Dec 03, 2019 9:44 am
Forum: Python
Topic: Parent script termination
Replies: 17
Views: 576

Re: Parent script termination

Almost certain that both subprocess, threading, import etc are all not the way forward here. Your main program will have a "main loop" which updates the screen and responds to any key/mouse events. You should keep a record of what mode you are currently in, main program or sub-program. When the main...
by scotty101
Fri Nov 29, 2019 9:38 pm
Forum: Python
Topic: [guizero] import error Drawing [solved]
Replies: 4
Views: 117

Re: [guizero] import error Drawing

Check which version of guizero you have

Code: Select all

import guizero
print(guizero.__version__)
Drawing was introduced in version 0.6.1

You can always use pip to grab the latest version as described in the guizero docs.
by scotty101
Fri Nov 29, 2019 12:31 pm
Forum: Python
Topic: Difficulties with first python script (user input yes/no)
Replies: 19
Views: 475

Re: Difficulties with first python script (user input yes/no)

You need to put it on the line before exit 0 and if you call it like this hopefully the error will be written to the error.txt file which might give you a clue as to why its not working. python /home/pi/fbcp-ili9341/build/startup_script.py >> /home/pi/error.txt 2>&1 & note your need the last "&" so...
by scotty101
Thu Nov 28, 2019 1:14 pm
Forum: Automation, sensing and robotics
Topic: Using pi to simulate a push-to-exit button
Replies: 3
Views: 140

Re: Using pi to simulate a push-to-exit button

You need some extra circuitry, namely a relay to act as a switch to close the contacts. Depending on your skill level, you can either buy some components and wire them up to drive a relay (there are many many tutorials on how to do this) or you can buy a pre-built HAT which has relays on it. I've ha...
by scotty101
Tue Nov 26, 2019 3:47 pm
Forum: Other projects
Topic: Need Help for installing some CCTV software
Replies: 2
Views: 130

Re: Need Help for installing some CCTV software

Have a look at MotionEyeOS (https://github.com/ccrisan/motioneyeos/ ... stallation)

It allow you to record from multiple cameras and can be configured to store video files on external storage devices
by scotty101
Tue Nov 26, 2019 1:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: how to detect HW RTC on addr 0x68
Replies: 5
Views: 151

Re: how to detect HW RTC on addr 0x68

Which language do you want to do this in?

There is a python example using pigpio here https://www.raspberrypi.org/forums/view ... 01#p782381
by scotty101
Wed Nov 20, 2019 9:51 am
Forum: Python
Topic: Importing modules in modules
Replies: 3
Views: 148

Re: Importing modules in modules

This is pretty standard. Go ahead.

Look at any of the current python code for using I2C devices and they will do exactly the same thing.
by scotty101
Tue Nov 19, 2019 1:18 pm
Forum: Automation, sensing and robotics
Topic: Smart Coffee Machine Pump Controlled by Raspberry Pi & HC-SR04 Ultrasonic Sensor
Replies: 3
Views: 177

Re: Smart Coffee Machine Pump Controlled by Raspberry Pi & HC-SR04 Ultrasonic Sensor

Great project!

You just need another pump and a bigger tank to keep the water cooler bottle full :D
by scotty101
Tue Nov 19, 2019 12:29 pm
Forum: Beginners
Topic: How many of the GPIO pins are able to be used for HX711?
Replies: 4
Views: 195

Re: How many of the GPIO pins are able to be used for HX711?

Looks like the HX711 sensor is "bit-banged" to read it's data rather than using an SPI or I2C interface. Each sensor requires two GPIO pins. You can use all of GPIO pins if you disable the UART, SPI and I2C peripherals so theoretically you could use 13 sensors directly connected the Pi. https://gith...
by scotty101
Thu Nov 14, 2019 10:34 pm
Forum: Troubleshooting
Topic: buttons as mouse
Replies: 1
Views: 90

Re: buttons as mouse

OS: Use Raspbian
For moving the mouse pointer use something like pynput.
https://pypi.org/project/pynput/
by scotty101
Wed Nov 13, 2019 12:24 pm
Forum: Python
Topic: Read log file as lines are added into guizero textbox
Replies: 2
Views: 93

Re: Read log file as lines are added into guizero textbox

I'm not near a Pi to test/try and fixes but there are a few issues. Your LogWindow function can potentially take a number of seconds if not longer to complete so while it is running, guizero can't update the GUI. Rather than doing this, use the .repeat method in gui to schedule reading of the file p...
by scotty101
Tue Nov 12, 2019 10:55 am
Forum: Python
Topic: GUIZERO Button waits for process called to finish
Replies: 3
Views: 119

Re: GUIZERO Button waits for process called to finish

Are you using subprocess.run or subprocess.Popen?

Run will always wait, Popen can be configured to not wait.
See https://stackoverflow.com/questions/351 ... -dont-wait
by scotty101
Mon Nov 11, 2019 11:07 am
Forum: General discussion
Topic: HOT Raspberry Pi 4 - 4GB
Replies: 22
Views: 1496

Re: HOT Raspberry Pi 4 - 4GB

rosinski wrote:
Sun Nov 10, 2019 8:24 pm
My conclusion is that I would NOT recommend the official RPI4 case as it just runs too hot. Get yourself a new case with a fan (and some heatsinks) and that will only cost you $10-15.
Unless it is throttling itself because of the temperature, it isn't running too hot. 70 degrees is fine.
by scotty101
Fri Nov 01, 2019 12:19 pm
Forum: Automation, sensing and robotics
Topic: PI 3 DRONE THAT CAN BE AUTOMATED USING PYTHON (NEWBIE)
Replies: 5
Views: 485

Re: PI 3 DRONE THAT CAN BE AUTOMATED USING PYTHON (NEWBIE)

Not to stamp over over your ambitions but this is a massively complicated task for a beginner unless you have previous quadcopter experience. This is like to take months of effort which you may not have. May I suggest that you look for a prebuilt quadcopter that has something like an ArduPilot fligh...
by scotty101
Wed Oct 30, 2019 4:13 pm
Forum: Automation, sensing and robotics
Topic: RPi-ESP32 Books
Replies: 13
Views: 1275

Re: RPi-ESP32 Books

What are you looking for a book on?
Raspberry Pi and ESP32 are two totally different things.
Yes there are often used together but I doubt there is a single book that covers both.
by scotty101
Wed Oct 30, 2019 1:16 pm
Forum: Weather station
Topic: Sense hat project.
Replies: 6
Views: 1459

Re: Sense hat project.

Try using the trinket.io Sense hat emulator to test your code.

Here is an example that will
1. Write out the temperature every 2 seconds
2. Set the text color to red if the temperature is greater than 20, otherwise set it to white.

https://trinket.io/python/34f7745986

Go to advanced search