Smarthomewatch: Hacking on Pebble Watch For Home Automation

Check out this home automation project for the Pebble watch from Enrico on makr.com:

I really enjoyed my pebble (too bad caller ID is not working, yet), and i’m very happy to have been one the sponsors of the “rise of the smartwatch” series.

pair this brand new gadget with my interests in home automation, add the release of the pebble sdk, stir it with some juicy python examples, and there you are: a smarthomewatch!

first things first.

to start you need to have a working libpebble setup. i followed the pretty clear readme of this github homepage.

i followed the advice of using the lightblue library as the wrapper around bluetooth stack: looks pretty outdated, but works even on my up-to-date mountain lion powerbook.

if this is your case, before trying to use the libpebble scripts, follow the instructions you can find here. (that’s a fork adapted to run on macos 10.8)

as soon as i drilled down inside the clean code of the “p.py” file, i realized how easy it would have been to tweak it, and thought: how about that ETH-RLY ethernet relay board i played with in python some weeks ago?

let’s glue them together … and the first smarthomewatch was born! to avoid having to set up a specific application i used the “music” menu, putting my relay list as if it was a playlist, using the play/pause button as a relay toggle.

the code i’m posting is pretty draft, looking more like a hack of the original file, rather than a proper software module. but hey: it works! …

Read more.



Led Dimming & Motor Speed Control with Soft PWM in RPi.GPIO 0.5.2a #piday #raspberrypi @Raspberry_Pi

How to drive leds and motors with PWM & RPi.GPIO on the Raspberry Pi:

In part 1 of this series, we looked at the basic commands for using software pulse-width modulation (PWM) in RPi.GPIO 0.5.2a and higher. In this article we’ll get a bit more hands-on and into some practical applications for it. It’s all very well being able to make nice square-wave pulses on an oscilloscope, but what’s it actually useful for?

Source code and more here!


998Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro”? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.

We now have Raspberry Pi Model B with 512MB RAM in stock and shipping now!



Physical WakeOnLan button with Raspberry Pi and Python

Physical WakeOnLan button with Raspberry Pi and Python via Code Container

This is a fun little demo I threw together in an evening. I’m running Raspbian “wheezy”.

Source code and more here!



Having fun with the Massive Arcade Button, Raspberry Pi and, Python

The Massive Arcade Button makes it fun to collect data! Shared by Todd Dailey, @twid:

Daughter’s science project 90% done, shout out to @raspberry_pi @adafruit and Python :)

Read more.


Featured Adafruit Products

Massive Arcade Button with LED – 100mm Red – OMG WATCH OUT! This 100mm diameter arcade button is so massive and inviting it may collapse upon itself and form a black hole from which not even light can escape! Until it does, however, it ready for all sorts of pressing and pushing. Science has shown no one can resist pressing its shiny surface and saying “beep!”. We’ve seen these on some games of skill in arcades, they’re easy to mount on nearly any kind of enclosure. They’re not waterproof or weatherproof, so best used indoors. (read more)



How to use interrupts with Python on the Raspberry Pi and RPi.GPIO

How to use interrupts with Python on the Raspberry Pi and RPi.GPIO

This is the first in a series of articles which aim to show you how to use this new interrupt facility in Python.

Interrupts are a much more efficient way of handling the “wait for something to happen and react immediately when it does” situation. They free up the resources you would have wasted on polling, so that you can use them for something else. Then, when the event happens, the rest of your program is “interrupted” and your chosen outcome occurs.

Source code and more here!

Filed under: python,Raspberry Pi — by jeff, posted at 1:00 pm


Hacking the Minecraft world #piday #raspberrypi @Raspberry_Pi

Liz shares about the exciting coding opportunities in Minecraft: Pi Edition!

From RaspberryPi.org:

If you’re a Minecraft fan and a Pi owner, you’ve probably already downloaded a copy of Minecraft: Pi Edition. But are you getting the most out of the fact that you can modify the world with code in-game?

If you’re not sure where to start, or if you’re looking for ideas (sometimes being given a blank canvas can be lousy for getting the brain sparking), Martin O’Hanlon at the marvellous <Stuff about=”code” /> has several tutorials on Minecraft: Pi Edition, from installing the game to using the Minecraft API to build wonderful things, like magical bridges that appear where’er you walk, games of hide and seek, and in-game analogue clocks.

The hide and seek hack is easy and rewarding: with a little coding you’ll be able to get the game to hide a diamond somewhere in the world for you to find, and to give you hints of the warmer/colder variety.

You can find code and an explanation of what’s going on over at Stuff About…

And we’re all agreed that the clock is just brilliant (it’s also big enough that you can go and stand on the hands). Again, the project has its own page with code and a spot of discussion.

We’d love to see what you’ve been doing in Minecraft – take some video, or write something about your experiments on your own website, and let us know about it!

Read more.



A Python Library for Raspberry Pi and Adafruit Digital RGB LED Strips #piday #raspberrypi @Raspberry_Pi

Here’s a great new python library for the Adafruit Digital RGB LED Strips, shared by Julio Terra:

Earlier today I published the first beta release of the LED Strip python library that we created at the LAB for the Raspberry Pi. This library was developed to be used with the Digital RGB LED strips from Adafruit – our favorite LED strip.

We have been playing with these for quite a while using Arduinos, and Adafruit’s Arduino library. With that in mind, we structured out library similar to the Arduino library from Adafruit. To help you get up and running quickly, we put together two examples scripts and a readme file featuring an initial draft of the documentation.

One of the reasons that we are so excited about using the LED strips with Raspberry Pis is that they play really nicely with Spacebrew – the LAB’s dynamic routing tookit/service. This is especially true since Adam Mayer developed an awesome python Spacebrew library at our meet-up in January.

Here is a link to the Spacebrew python library repo. Make sure to go through the readme file because you’ll need to install several dependencies to get the Spacebrew library up and running on your device. I’ll post more information about this library sometime in the coming week or two.

Read more.



SPI-Python: Hardware SPI for RasPi from Python #piday #raspberrypi @Raspberry_Pi

SPI-Python

Here’s a tutorial how to AVOID bit-banging and use the hardware via C (while still in Python), shared by Louis Thiery in the Adafruit Forums. And here is the code in Github.

This implementation of SPI in Python is hardware based. Linux-level C code is compiled as a Python module. I first learned how to get SPI working on the Raspberry Pi with help from a tutorial by Brian Hensley. However, I love Python and I wanted to use this hardware implementation of SPI from within Python. I little searching told me that what I wanted to do was to “extend” Python with C and so this reference was very helpful.

Read more.


998Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro” ? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.

Want a FREE RASPBERRY PI? All orders over $350 get a FREE Raspberry Pi Model B with 512MB RAM!



NEW BOOK – Python for Kids – A Playful Introduction to Programming

Window-400

NEW BOOK – Python for Kids – A Playful Introduction to Programming. Python is a powerful, expressive programming language that’s easy to learn and fun to use! But books about learning to program in Python can be kind of dull, gray, and boring, and that’s no fun for anyone. Featuring original artwork by Miran Lipovača. Full color, over 344 pages.

Python for Kids brings Python to life and brings you (and your parents) into the world of programming. The ever-patient Jason R. Briggs will guide you through the basics as you experiment with unique (and often hilarious) example programs that feature ravenous monsters, secret agents, thieving ravens, and more. New terms are defined; code is colored, dissected, and explained; and quirky, full-color illustrations keep things on the lighter side.

Chapters end with programming puzzles designed to stretch your brain and strengthen your understanding. By the end of the book you’ll have programmed two complete games: a clone of the famous Pong and “Mr. Stick Man Races for the Exit”—a platform game with jumps, animation, and much more.

As you strike out on your programming adventure, you’ll learn how to:

  • Use fundamental data structures like lists, tuples, and maps
  • Organize and reuse your code with functions and modules
  • Use control structures like loops and conditional statements
  • Draw shapes and patterns with Python’s turtle module
  • Create games, animations, and other graphical wonders with tkinter

Why should serious adults have all the fun? Python for Kids is your ticket into the amazing world of computer programming.

In stock and shipping now!

(more…)

Filed under: books,python — by adafruit, posted December 27, 2012 at 6:10 pm


Multiple Serial Devices in One Terminal

MultiColorMultiSerial

Multiple Serial Devices in One Terminal, from John Donnal:

My good friend and all around computer genius [Jim] has produced quite a nice terminal program that can host multiple serial devices in a single prompt. Its super easy to use. In hurry? Grab the git repo: https://git.jim.sh/jim/terminal.git. Just add all the devices you want to display as command line arguments and *presto* you have a color coded super prompt.

This is a great tool for debugging multiple devices at once. My latest project involves an EZ430 wireless kit and unfortunately I don’t have the $$ for IAR or CodeWorks. *yet*. So I am forced to use gcc which is cool but the Simpliciti network stack for the EZ430 has to be ported over and there are all sorts of hiccups and bugs that plague this sort of wireless network setup.

Read more.



Two Python Packages to Investigate #piday #raspberrypi @Raspberry_Pi

Part of working with your Raspberry Pi is learning to code in Python to take advantage of working directly with the device. While the Adafruit WebIDE is one of the easiest way to roll up your sleeves and build from nothing — you may also find for certain projects that you will want to install packages that have great tools and functionality already built-in.

Take some time to check out what is out there; adding in code snippets doesn’t just help you get what you need more quickly, it helps you learn how others have solved the problems you are tackling.

pygame

A great tool used for more than just games — also for playing back media and setting up lightweight interactive GUIs.

Pygame is a set of Python modules designed for writing games. Pygame adds functionality on top of the excellent SDL library. This allows you to create fully featured games and multimedia programs in the python language. Pygame is highly portable and runs on nearly every platform and operating system. Pygame itself has been downloaded millions of times, and has had millions of visits to its website.

Read More.

PyMedia

In many ways the go-to package for playing back compressed media in Python, but make sure you prepare for the dependencies and set your expectations for what media can be played back over a $35 computer at an appropriate level.

is a Python module for wav, mp3, ogg, avi, divx, dvd, cdda etc files manipulations. It allows you to parse, demutiplex, multiplex, decode and encode all supported formats. It can be compiled for Windows, Linux and cygwin.

PyMedia was built to be really simple and flexible at the same time. See tutorial for example. It allows you to create your own mutimedia applications in a matter of minutes and adjust it to your needs using other components. Python language is choosen because of simple semantics, complete and reach set of features.

Take a look at the PyCar application which takes advantage of the PyMedia library extensivelly and can turn your PC into the powerful car media center.

Read More.


998Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro” ? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.



Learn Python the Hard Way #piday #raspberrypi @Raspberry_Pi

Lpthwbook

I have often heard programmers recommending Zed A Shaw‘s book Learning Python the Hard Way as an excellent way for a novice programmer to build a firm foundation not only in Python, but in coding as a discipline. The “hard” part is the insistence that the student type in all of the exercises by scratch, forcing a little muscle memory, in addition to learning to solve problems as efficiently as possible.

I encourage you to consider picking up the physical book as well, but those who want to check out this resource before buying will be happy to see that the HTML version of the book is free online at the book’s website.

It occurs to me that uniting the Hard Way with the Adafruit Raspberry Pi WedbIDE — the easiest way to learn programming on a Raspberry Pi — might be a killer combination.


998Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro” ? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.

Filed under: python,Raspberry Pi — by Matt, posted at 7:00 am


www.flickr.com
adafruit's items Go to adafruit's photostream
www.flickr.com
items in Adafruits More in Adafruits pool