Wired Living

Saturday 14 April 2007

USBMicro - XPL Application (Input)

After a visit to the local Electronics store to pick up some bits and pieces (been a very long while since I've touched a soldering iron!) I setup a basic circuit to wire a switch & a PIR (a cheapo eBay purchase too!) to the USBMicro board.


I used XPL VB6 Framework demo app - and mashed it with the demo USBMicro input app - and before I knew it - I had it broadcasting status changes over my network!

The current app works by polling the device every 500ms and if any changes are detected, sends the status for all ports on the device.

Other functions to add:
  • Add code to only send status updates on the changed input - to reduce noise.
  • Stick in some checks (like to make sure the USBMicro device is attached first would be useful! :) - and perhaps re-check periodically
  • Allow the ability to set friendly names of each port in XPLHal (instead of device0>device16).
  • Respond to status requests (so XPLHal can get initial status on startup)

Since this USBMicro also supports reading of 1-wire sensors, I may have a crack at wiring one up to this too - so I don't need to use the temperature sensor kit and obviously build the functionality into the XPL app as well.

May also find some other useful applications for this. I'm open to any suggestions on ways of utilising this device too - so drop me a comment on here if you come up with any.

USBMicro's Capabilities:

  • 16 Digital inputs (ie. this project)
  • 16 Digital Outputs (could use to control relays)
  • Interface to SPI Devices
  • Interface LCD Controllers
  • Stepper Motor Control
  • 1 Wire Sensors (temprature)

Anyway, all I can say is I really enjoyed getting this up and running! Was a good mashup of electronics & coding - which I haven't done either of for quite a while. It has gotten me thinking about other devices I have around that I can integrate into my XPL network. Perhaps something with bluetooth....

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home