Electronics and Programming for All
Python
Simple Power Loss Detector with SMS Notification
Jun 28th
After having a few un-expected power outages this year, it got me thinking about how I could easily (and cheaply) be alerted (preferably via SMS) should one occur. With a laptop running Linux, a little bit of Python and some easily obtainable hardware and software, I come up with a simple method of doing just that. Read on for the code and set-up instructions. More >
From HPR: Python Roundtable Discussion
Feb 11th
This may be old news to some of you but I thought it was interesting enough to warrant a blog post.
The Podcast site Hacker Public Radio has a rather interesting episode about the current and future plans for the development of Python. Hope it’s useful to someone.
Handy Link: bpython
Dec 31st
bpython is a Python interpreter interface on steroids! It’s main features are:
- Syntax Highlighting
- A save function (to save code you’ve entered to a file)
- Auto-intending (we all know how important correct indenting is when you’re writing python scripts!)
- Auto-Completion which displays suggestions for any built-in functions, helping you to get the syntax for a statement spot-on without having to dig through reference manuals. The auto-completion feature also helps with import declarations, showing you a list of available modules as you type.
Installation in Ubuntu is as painless as typing sudo apt-get install bpython Other packages are available for Debian, Fedora and OpenSUSE as well. You can also obtain the source code from here and compile it yourself if need be.
If you need any help with using bpython, then check out the project’s webpage. Hope this is useful to someone.
Happy new year!
Handy Link: “Invent with Python”
Dec 29th
Need an accessible guide to learning Python that won’t send you to sleep? “Invent with Python” is just what you need!
Invent Your Own Computer Games with Python, 2nd Edition (to give it its full title) is a book written by Al Sweigart. It is available for free on-line in both HTML and PDF format. You can download the PDF format from here.
The book is released under a Creative Commons licence and is aimed at people who are completely new to programming.
Comprised of 19 Chapters (at the time this post was written), it guides the reader through the basic concepts (Installation of Python, use of the Python interactive shell, Variables, functions, etc) and some of the more advanced stuff as well.
The coding examples in the book are all games (so you can actually have some fun with what you create as you go through the book!), which increase in complexity as the chapters progress.
There is also a Blog related to the book, so you can keep up with any future additions that are made to it.
Taken the Python Challenge?
Oct 16th
Want a great way to learn a programming language and have some fun? Why not take the Python Challenge. Just found out about this little gem on hackaday and thought I’d post it here to help spread the word.
The Python Challenge site consists of a series of levels ( 33 levels at present) in which you have to solve puzzles of increasing complexity using code you write yourself. Each puzzle solution then gives you access to the next level.
The site also has a great community behind it, with forums if you get really stuck and need a hint.
From Hackaday: Arduino Snow Clock
Jul 1st
This Alarm Clock Arduino hack , featured on hackaday, has to be one of the most innovative uses of an Arduino and Python I have seen! The maker, insingertech, has published full instructions on his hack here.
He goes into great detail on his build process and the diagrams (for the Relay Driver part of his circuit, especially) really help to explain things.
The only critisism I can think of here is that perhaps he should have used an Ethernet Shield for the network connectivity element of his project instead of a PC/Laptop.
Webthermo: Web-based Temperature Monitor
Mar 13th
Ok, so someone has already beaten me to it (and done a excellent job of it as well) with the whole web-based temperature monitoring thing, but anyway… Here’s Webthermo!
Webthermo, my follow-up to Ardthermo, is a small, web-enabled Python script which uses the CherryPy HTTP Python framework. It allows you to monitor temperature (in both Celsius and Fahrenheit units) over the Internet (using the port-fowarding facility of your Router), or on your own LAN via a web browser, your favorite RSS reader or a WAP-capable Mobile phone, using the same Arduino sketch and hardware setup as was used for Ardthermo.
It’s still in the early stages of development at the moment, so its still a bit rough around the edges but it works well enough. You can get a copy of the Python script, which also includes the Arduino sketch needed for the hardware side of things, from the Software page.
System Requirements and instructions on how to use Webthermo can be found below. Enjoy everyone!
Fun with PyRSSI, an Arduino and Twitter
Mar 7th
In this little project, the RSSI value (detected by a small python script) is used to control 3 LED’s on an Arduino. The LED’s are used to indicate the proximity (in terms of Far Away, Slightly Closer and Very Close) of a paired device relative to the PC running the script. The python script can also send a message to Twitter when the paired Bluetooth device is in close proximity to the PC.
The Arduino Sketch and companion Python script are both in the zip file rssitracker.zip which can be downloaded from the Software page.
Arduino-based Talking & Remote Thermometer
Mar 2nd
After recently getting my hands on an Arduino Duemilanove, I came across this Sketch on Arduino Playground that allowed an Arduino to function as a temperature measuring device with the addition of a few cheap and easily obtainable components.
Deciding to take things a step further, I wrote a Python script to create a DIY temperature measuring device that could be used both locally, via the command line, as well as remotely, using a googlemail account to check the temperature of a room. You can grab a copy of this script, called “Ardthermo”, from the Software page.
This article should give all the info you need to know to build this little project for yourself and make use of the Ardthermo script. Enjoy.





Recent Comments