Go to advanced search

by scotty101
Fri Jan 19, 2018 8:34 pm
Forum: Beginners
Topic: Multiple scripts on Pi
Replies: 2
Views: 71

Re: Multiple scripts on Pi

Not sure why you'd need two separate scripts. Just use threading to run a background task that reads the distance and that can communicate to the main program if the distance is too close.
by scotty101
Fri Jan 19, 2018 1:37 pm
Forum: Media centres
Topic: Raspberry pi 3 (Media Center)
Replies: 1
Views: 113

Re: Raspberry pi 3 (Media Center)

Install OSMC. Connect to TV. Done.
by scotty101
Fri Jan 19, 2018 11:09 am
Forum: Off topic discussion
Topic: Something new
Replies: 7
Views: 316

Re: Something new

mistofeles wrote:
Fri Jan 19, 2018 10:42 am
An IIC FRAM FM24CL26 is so small 8 pin chip that it should find space on RaspberriPi board.
Every component added increases the cost of the Pi. Yes you might want this chip but what percentage of the over 15 millions Pi's sold would benefit from it?
Just add it yourself if you need it.
by scotty101
Fri Jan 19, 2018 10:57 am
Forum: Beginners
Topic: Using L293D Driver with Raspberry Pi 3 and Accelerometer
Replies: 1
Views: 68

Re: Using L293D Driver with Raspberry Pi 3 and Accelerometer

The internet is full of examples explaining how to use the L293D with a raspberry pi. Here are some results https://business.tutsplus.com/tutorials/controlling-dc-motors-using-python-with-a-raspberry-pi--cms-20051 http://www.instructables.com/id/DC-Motor-Control-With-Raspberry-Pi-and-L293D/ Each mot...
by scotty101
Fri Jan 19, 2018 10:38 am
Forum: Beginners
Topic: Soldering a Door Alarm
Replies: 1
Views: 51

Re: Soldering a Door Alarm

Have you had a look at the Raspberry Pi learning resources.
This one about Physical Computing with Python will be helpful for you.

A magnetic door sensor is just a switch. One end can be connected to a Ground (GND) pin and the other connected to an available GPIO pin (GPIO 17 for example)
by scotty101
Thu Jan 18, 2018 8:34 pm
Forum: Python
Topic: Analogic reading using thread not working! help!
Replies: 7
Views: 194

Re: Analogic reading using thread not working! help!

Why not do a rolling average

value = (previous_value + new_value) / 2
by scotty101
Thu Jan 18, 2018 3:42 pm
Forum: Teaching and learning resources
Topic: GuiZero & the SenseHAT
Replies: 7
Views: 201

Re: GuiZero & the SenseHAT

bensimmo wrote:
Thu Jan 18, 2018 2:31 pm
I can do what I like to mine, these are just T&L (section we are in) ideas and resources for anyone that happens to be looking.
Yep and I'm trying to help :D
by scotty101
Thu Jan 18, 2018 3:40 pm
Forum: Troubleshooting
Topic: Pi detecting activity - resistor needed?
Replies: 24
Views: 492

Re: Pi detecting activity - resistor needed?

You could try some different wire.

Some Ethernet cable may be helpful since it contains multiple twisted pairs and has shielding.
by scotty101
Thu Jan 18, 2018 3:25 pm
Forum: Beginners
Topic: Convert movie audio on the fly
Replies: 4
Views: 71

Re: Convert movie audio on the fly

A more 'finished' solution would be to install OSMC on to your Pi.
OSMC can connect to your NAS and import the media. The video player inside OSMC is more than capable of reading a wide variety of audio and video format and containers.
by scotty101
Thu Jan 18, 2018 1:56 pm
Forum: Teaching and learning resources
Topic: GuiZero & the SenseHAT
Replies: 7
Views: 201

Re: GuiZero & the SenseHAT

If you are able to modify your version of Guizero, I've created a branch that supports a textbox with multiple lines. Example of usage shown below. from guizero import App, TextBox def new_text(): textbox.set("Hello Setting\nText") print(textbox.get()) app = App() textbox = TextBox(app,multiline=Tru...
by scotty101
Thu Jan 18, 2018 1:19 pm
Forum: Teaching and learning resources
Topic: GuiZero & the SenseHAT
Replies: 7
Views: 201

Re: GuiZero & the SenseHAT

So I would create a textbox (though it seems we cannot increase the height like a true textbox :( Its a missing feature from guizero. There are two text entry widgets in Tkinter, Entry and Text. Entry is single line, Text is Multiline. GuiZero only implements Entry limiting us to single line only. ...
by scotty101
Wed Jan 17, 2018 1:13 pm
Forum: Teaching and learning resources
Topic: GuiZero & the SenseHAT
Replies: 7
Views: 201

Re: GuiZero & the SenseHAT

Did you see my sense_draw application? https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=202010 It has an example of converting from Hex to RGB and allows you to directly draw sprites on to the sense hat. BTW I added the clickable waffle functionality to guizero so I'll take look to see if I c...
by scotty101
Wed Jan 17, 2018 1:06 pm
Forum: Python
Topic: string stamp on cam pic taken
Replies: 12
Views: 213

Re: string stamp on cam pic taken

Remove the very last "

Code: Select all

timestampCommand = "/usr/bin/convert " + completeFilePath + " -pointsize 36 \
    -fill red -annotate +700+450 '" + timestampMessage + "' " + completeFilePath +" "+stringStamp
by scotty101
Wed Jan 17, 2018 12:02 pm
Forum: Python
Topic: string stamp on cam pic taken
Replies: 12
Views: 213

Re: string stamp on cam pic taken

Judging from the code you've provided, I'd guess that convert relates the convert provided with imagemagick.

Code: Select all

sudo apt-get install imagemagick
by scotty101
Wed Jan 17, 2018 11:28 am
Forum: Python
Topic: string stamp on cam pic taken
Replies: 12
Views: 213

Re: string stamp on cam pic taken

Do you have /usr/bin/convert on your Pi? Might not be installed by default. ls -l /usr/bin/convert Run that code in a terminal to find out. can i import the code you gave me somehow? Its easier when theres not so much code Sure. Lets say you save my code as settings.py. You could import it with from...
by scotty101
Wed Jan 17, 2018 10:42 am
Forum: Raspbian
Topic: Time sync with ntp on Stretch - how often?
Replies: 6
Views: 227

Re: Time sync with ntp on Stretch - how often?

Question has been answered here
viewtopic.php?f=66&t=168333
by scotty101
Wed Jan 17, 2018 10:38 am
Forum: Python
Topic: string stamp on cam pic taken
Replies: 12
Views: 213

Re: string stamp on cam pic taken

but i still need rest of the code for capturing and add string The code you posted already has examples of doing that. Break the task down in to smaller parts and identify what you need to do and learn how to do it. Happy to help if you get stuck but you need to learn how to do things for yourself.
by scotty101
Wed Jan 17, 2018 10:26 am
Forum: Official Foundation Display
Topic: Official 7" Touchscreen
Replies: 3
Views: 132

Re: Official 7" Touchscreen

Sounds like it is booting to the console rather than GUI.

Log in using
username: pi
password: raspberry

then type startx to start the GUI.

Once in the GUI you can change the Raspberry Pi Configuration to always boot to GUI.
by scotty101
Wed Jan 17, 2018 10:23 am
Forum: Python
Topic: string stamp on cam pic taken
Replies: 12
Views: 213

Re: string stamp on cam pic taken

Below is a working extract/modification of some code I've used in the past to save settings between uses of a python script. It saves the data in JSON format and can be easily extended to support adding more settings to the file. Probably total overkill for your application but it should work import...
by scotty101
Wed Jan 17, 2018 8:00 am
Forum: General discussion
Topic: looking for a simple and lightweight music player for PI ZERO
Replies: 11
Views: 360

Re: looking for a simple and lightweight music player for PI ZERO

Then there is also the Volumio project, which distributes their own custom mpd player and surrounding Operating system. I know that most users use it over a web interface on their LAN, headlessly, but am not sure how easy it is to control it with other means. https://volumio.org/ Volumio just uses ...
by scotty101
Wed Jan 17, 2018 7:53 am
Forum: Beginners
Topic: Is my adafruit tft compatable
Replies: 1
Views: 86

Re: Is my adafruit tft compatable

The same screen is available specifically for the Raspberry Pi https://www.adafruit.com/product/2441 https://learn.adafruit.com/adafruit-pitft-3-dot-5-touch-screen-for-raspberry-pi The problem you will have with the "non-pi" version that you already have is that the touchscreen requires two analogue...
by scotty101
Wed Jan 17, 2018 7:43 am
Forum: Add-ons
Topic: Use a skywriter hat with access to other GPIO pins
Replies: 2
Views: 116

Re: Use a skywriter hat with access to other GPIO pins

Is it possible to wire up the skywriter hat (Or any hat for this matter) to a breadboard and then to the correct GPIO pins to free up space for other breadboard usage? Yes. You've found the links on pinout.xyz and how to connect the pins. If you have wired them up correctly, it should work. Then le...
by scotty101
Tue Jan 16, 2018 7:20 pm
Forum: General discussion
Topic: looking for a simple and lightweight music player for PI ZERO
Replies: 11
Views: 360

Re: looking for a simple and lightweight music player for PI ZERO

MPD and MPC would be a good choice. There is a python binding to control it.
by scotty101
Tue Jan 16, 2018 2:58 pm
Forum: Beginners
Topic: Interfacing an LDR to an ADS1115 ADC setup
Replies: 3
Views: 76

Re: Interfacing an LDR to an ADS1115 ADC setup

This image shows how you connect an LDR or another resistive sensor to an ADC. http://robotics.hobbizine.com/pics/ldrvdivider.jpg An ADC reads voltage therefore you need to apply a voltage supply across the LDR with a voltage divider. In this diagram Vout is connected to the ADC input. The battery i...
by scotty101
Tue Jan 16, 2018 12:06 pm
Forum: Beginners
Topic: Read ttyAMA0
Replies: 6
Views: 137

Re: Read ttyAMA0

Or use the library specifically designed for reading serial port data in python....

https://pythonhosted.org/pyserial/

Revolutionary! :roll:

Go to advanced search