Go to advanced search

by miketr3
Sat Sep 09, 2017 5:09 pm
Forum: Python
Topic: Importing a module
Replies: 2
Views: 1128

Re: Importing a module

DirkS wrote:
Sat Sep 09, 2017 5:06 pm
use pip3 instead of pip to install it.
This will set it up for Python 3
Excellent, many thanks.
by miketr3
Sat Sep 09, 2017 4:37 pm
Forum: Python
Topic: Importing a module
Replies: 2
Views: 1128

Importing a module

I needed to install minimalmodbus to use some sensors, so I followed the vendors instruction, sudo pip install minimalmodbus Everything works fine, BUT minimalmodbus only seems available in Python2. If I try the script in Python3 I get "ImportError: No module named 'minimalmodbus'. Why is the module...
by miketr3
Thu Aug 24, 2017 4:44 pm
Forum: Python
Topic: Radio button behaviour
Replies: 3
Views: 676

Re: Radio button behaviour

You will need to explicitly enable and disable the buttons. Below is a "modified" version of your sel function that does this. def sel(): selection = var.get() # From the selected radio button. print(selection) # Just to observe button behaviour if selection == 1: R1.config(state=DISABLED) R2.confi...
by miketr3
Thu Aug 24, 2017 3:39 pm
Forum: Python
Topic: Radio button behaviour
Replies: 3
Views: 676

Radio button behaviour

I'm using this code to switch a relay on or off. The ON and OFF radio buttons work fine. BUT, after selecting ON, if you click it again it responds again switching a different relay on. Surely after a radio button is selected it should not respond to further clicks, or am I missing something? from t...
by miketr3
Mon Aug 21, 2017 2:36 pm
Forum: Python
Topic: using a value from spinbox
Replies: 4
Views: 1079

Re: using a value from spinbox

Thanks both, all works fine now, and I've learned a few things as well.
by miketr3
Mon Aug 21, 2017 3:35 am
Forum: Python
Topic: using a value from spinbox
Replies: 4
Views: 1079

Re: using a value from spinbox

Yes that works and it prints the value.
But I want the variable "address" to have that value,

Code: Select all

address = (self.spinner.get())
But if I do that, I get the error "Integer required" and I don't understand this because it works when I use

Code: Select all

address = 0x22
which is not an integer.
by miketr3
Sun Aug 20, 2017 5:53 pm
Forum: Python
Topic: using a value from spinbox
Replies: 4
Views: 1079

using a value from spinbox

As a newbie I've tried writing a GUI for controlling an 8 channel relay board on the i2C bus. So far so good, but I'd like to use a selected value from a spinbox to set the address for the board. I know that .get() should be used, but after ages of looking at either reams of code, or incomplete desc...
by miketr3
Sat Jul 29, 2017 4:53 pm
Forum: Beginners
Topic: I2C
Replies: 7
Views: 1084

Re: I2C

Start with http://www.hobbytronics.co.uk/mcp23017-port-expander-board that gives you sixteen channels that can control 5V relays. For the sensors you may not get a choice whether things are SPI or I2C, depending on which sensors you're thinking of using. Dougie, this board seems ideal combined with...
by miketr3
Thu Jul 27, 2017 3:14 pm
Forum: Beginners
Topic: I2C
Replies: 7
Views: 1084

Re: I2C

You may find that running more than one of those sensors on a single I²C bus isn't possible. The MCP23017 has three address pins that allow you to change it from 0x20 to 0x27 inclusive on the I²C bus. According to the technical data it is possible to write a new address to each sensor, they all com...
by miketr3
Thu Jul 27, 2017 1:29 pm
Forum: Beginners
Topic: I2C
Replies: 7
Views: 1084

Re: I2C

You may find that running more than one of those sensors on a single I²C bus isn't possible. The MCP23017 has three address pins that allow you to change it from 0x20 to 0x27 inclusive on the I²C bus. According to the technical data it is possible to write a new address to each sensor, they all com...
by miketr3
Thu Jul 27, 2017 10:28 am
Forum: Beginners
Topic: I2C
Replies: 7
Views: 1084

Re: I2C

Start with http://www.hobbytronics.co.uk/mcp23017-port-expander-board that gives you sixteen channels that can control 5V relays. For the sensors you may not get a choice whether things are SPI or I2C, depending on which sensors you're thinking of using. Thanks for that. For sensors I'm thinking of...
by miketr3
Thu Jul 27, 2017 7:28 am
Forum: Beginners
Topic: How to increase storage of Raspberry pi 3
Replies: 15
Views: 15035

Re: How to increase storage of Raspberry pi 3

You could remove software you don't need, for example

sudo apt-get purge libreoffice wolfram-engine sonic-pi scratch
sudo apt-get autoremove
by miketr3
Wed Jul 26, 2017 11:55 am
Forum: Beginners
Topic: I2C
Replies: 7
Views: 1084

I2C

I'm considering a project that would use input from 4 sensors and control 4 solenoids, but I want the option to expand it to more devices. It would seem that I2C would be the best interface option. This is new territory for me, and lots of stuff I've read has assumed a level of knowledge. Can anyone...
by miketr3
Wed Jul 26, 2017 10:04 am
Forum: Other projects
Topic: refrigerator inventory project
Replies: 10
Views: 4679

Re: refrigerator inventory project

I've thought about this too. Too much end-user effort in terms of updating inventory, nobody wants a 2am trip to the fridge to be a math problem. RFID tags will only track initial quantities, what about partial product consumption? I would conclude that multiple points of data entry would need to b...
by miketr3
Sun Jul 23, 2017 8:54 pm
Forum: Other projects
Topic: Allotment Pi
Replies: 6
Views: 1075

Re: Allotment Pi

Hmm, what about a 12v programmable timer. Set Pi to shut down 1 hour after booting. Set programmable timer to switch on power to the Pi at 15:00 and off at 16:30 each day. An easier solution? Not 12V but WittyPi2 is a programmable timer that will wake/shutdown your RPi on a schedule. http://www.uug...
by miketr3
Sun Jul 23, 2017 8:03 pm
Forum: Other projects
Topic: Allotment Pi
Replies: 6
Views: 1075

Re: Allotment Pi

Hmm, what about a 12v programmable timer.
Set Pi to shut down 1 hour after booting.
Set programmable timer to switch on power to the Pi at 15:00 and off at 16:30 each day.
An easier solution?
by miketr3
Sun Jul 23, 2017 2:03 pm
Forum: Other projects
Topic: Allotment Pi
Replies: 6
Views: 1075

Re: Allotment Pi

Not really a solution because I would have to drive to the allotment, check if it needed watering, then drive back.
by miketr3
Sun Jul 23, 2017 11:10 am
Forum: Other projects
Topic: window shop display
Replies: 4
Views: 982

Re: window shop display

I've done a shop window display using a widescreen monitor and a Pi. The monitor is mounted on a home made plinth from mdf that contains the Pi, power supply, wifi dongle and a usb port on the side of the plinth. It runs a slideshow using feh https://man.finalrewind.org/1/feh/ The slideshow starts a...
by miketr3
Sun Jul 23, 2017 10:25 am
Forum: Other projects
Topic: Allotment Pi
Replies: 6
Views: 1075

Allotment Pi

Would like to use Pi to control watering in a polytunnel, with no mains power supply. So thinking solar + battery. But, the Pi does not need to be on all the time. So was thinking of using Arduino (in sleep most of the time) to switch Pi on at say 15:00 hours each day, check soil moisture, open sole...
by miketr3
Thu Jan 26, 2017 9:09 am
Forum: Raspberry Pi Desktop for PC and Mac
Topic: STICKY: Fixing booting of the x86 image on Macs
Replies: 21
Views: 33050

Re: Fixing booting of the x86 image on Macs

iMac (21.5-inch, Mid 2011) Thanks for your solution. Booted ok, but cannot get bluetooth mouse & keyboard to work; when the “searching for devices” window is active, the keyboard shows briefly then dissapears, and keeps repeating. Not a big issue, but thought I’d mention it. Footnote When I then boo...

Go to advanced search