Hackmeetup notes: Bubble Bobble theme song on my Arduino piezo

Hackmeetup last night was a new attendance record.

It also featured Mark saying “I’m finished with this project!”, again. A Bluetooth scanner project, which was using Rhino to wrap Java APIs, again.

There were some new faces, and lots of electronics know-how in the house. I learnt a ton from Micke, who show-cased his company’s home automation product: a dimmer for your lights. And also an RFID reader which was autonomous; it had its own network cable and all. It’s out was sending xPL messages to the network, like “if you, the automated lamp, is off, turn on, if not, do nothing”. (Cave: My loose interpretation of this might be off.)

I continued my investigations into the Arduino kit I bought at Reboot. The thermistor and the photoresistor got some exercise, and the piezo was used to play sounds, and soon after that we found a piece of software that Clay Shirky had been in on making, which allowed us to write sheet music notes with a duration. Thus armed, we set out on a chase after the Mario tune. I wanted the sounds when we enters the caves, but David found the better song: the Bubble Bobble theme. Looking at sheet music, coding notes, took a while. But it played. I have a rotten video about it here.

Morgan took pictures with a real camera, and I guess he’ll link to them sometime.

PS: I was in a co-worker’s dream last night “You were talking in Italian with a Spaniard.” The dream had vampires in it, too.

Hackmeetup on Javascript mini-report: RFID on Rhino

This past Tuesday, we ran another Hackmeetup. Same great location, same great time.

Mark ran a talk about Typography on the Web for an audience of three.

For the hardware experimentation session, Carl had left, so it was Mark, me, and David, and we all worked on the same project. Mark had brought a USB-connected RFID reader of the Phidgets brand, and the idea: Use Rhino to wrap the Phidgets Java API to the RFID reader in a JavaScript, so we could… script the thing.

Update: Physical.js is the software we wrote, now published under MIT license.

We printed out the Javadocs for the API, and began laughing at some of the names: getLEDOn(), getAntennaOn(). Then we whiteboard-sessioned up some simpler, JS-idiomatic names, and had our wishlist. Almost cheating: Rhino has __defineGetter__ and __defineSetter__. Then we scrambled to find out how Rhino’s Java-adapting mechanism really worked. Great fun! Mark was the only one with the Phidgets hardware and software platform installed, so he was typing what me and David sent to him.

Prototyping with Rhino is quick. Soon, we were able to read the RFID card that Mark brought, and also a keychain fob I had with me. When we had 30 minutes until the trains went, Mark said: Let’s also hook it up to chat Jabber! He installed an OpenFire XMPP server on his machine, created a “rfid” account, and had it send a message onTagEnter and onTagLeave (enter/leave sounds better than gain/loss: we’re web developers…). Then he took an extra step and made chat commands to enable/disable the LED and antenna.

We cheered. We’d done it all.

Conclusion: Working on the same project is very productive. This was the first time we had a theme, two speakers, a dropped talk, and gotten stuff Done and Ready and the end of the night. Also: snacks. Healthier snacks are better, so next time, let’s up the ante.