Sounds like a fun project! :)
-Emo
I have not heard of anyone adding an accelerometer yet, but it's certainly
possible and something that I'd like to see.
The 6 ADC-capable inputs are normally used for the six buttons. When you
press one of the buttons, that connects one of those signal lines to
ground. However, when the buttons are not pressed, the buttons are simply
not part of the circuit. So... if you were building a Meggy Jr without
buttons or just didn't press them, you could just wire it up as in that
tutorial, with the buttons still in place. (No damage will occur from
shorting the accelerometer outputs to ground; that's specified in its
datasheet.) The one thing that you'd need to keep in mind is that the
accelerometer requires a lower-voltage power supply... so you might want
to consider adding a tiny 3.3 V regulator as well.
If you want to use both the buttons and the accelerometer at the same time
that requires more care-- if you need to clearly distinguish a button
press from a "railed" signal on the acceleration.
So what you would want to do (ideally) is put a couple of voltage
dividers on the 5 V to give you 0.25 V and 3.5 V power rails that can go
to the accelerometer, as its "gnd" and "vcc" supplies, respectively.
Then, connect the three outputs to three Meggy analog inputs through 1k
resistors. Having done this, the input value on the Meggy will read 0 V
only when the button is pressed. When the button is not pressed, there
will be a valid analog signal between 0.25 V and 3.5 V at the input.
As far as where to put it all... well, that's a harder question. :)
One way might be to build a "backpack" board for the Meggy Jr that takes
the place of the existing rear cover plate.
-Windell
--
You received this message because you are subscribed to the Google Groups "MeggyDev" group.
To post to this group, send email to megg...@googlegroups.com.
To unsubscribe from this group, send email to meggydev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/meggydev?hl=en.
> Thanks for the advice! I'll have to order an accelerometer breakout board and play around with it a bit. If pins are really an issue would building a more advanced breakout board with a microcontroller to monitor the accelerometer and communicate with meggy through I2C, etc. be an (expensive) option?
Since I2C lives on the same pins as the analog inputs, there really wouldn't be much advantage to that approach.
One non-invasive approach with an external board would be to use a tiny microcontroller that reads out the three analog inputs from the accelerometer and sends them -- over the serial port -- to the Meggy Jr RGB.
The microcontroller could be as simple as an ATtiny10 that bit-bangs its data to the RX pin of the Meggy, and there are a lot of other ways to do that as well.
-Windell