Native demo using accelerometer - code and video

56 views
Skip to first unread message

g. wygonik

unread,
Dec 24, 2014, 4:07:15 PM12/24/14
to cube...@googlegroups.com
I've been having fun working on a few demos using the L3D Cube "Christmas Edition" and the first one I feel is ready to share is a simple demo using the accelerometer. I create a "ground plane" that stays level as you rotate the cube left and right. Additional work could be done to also keep it level with forward/back, but I've moved on to another demo.

Here is a video: https://vimeo.com/115357826

And here is the code: https://gist.github.com/gwygonik/dee80233dffe22bc5227#file-l3dcubeaccelerometerdemo-ino

Be sure to add the Adafruit Neopixel library in Spark Build.

This demo has sparked (no pun intended) ideas of building a platformer game that makes your character (probably a small 2x2 pixel cube) run across a landscape, having to tilt to get different objects for points, or avoid traps or holes.

Cheers,
g.

alex hornstein

unread,
Dec 26, 2014, 2:01:23 AM12/26/14
to cube...@googlegroups.com
g!  This is awesome!  Now I want to write some kind of a labyrinth game!  Soo cool!

--me

g. wygonik

unread,
Dec 26, 2014, 11:15:46 PM12/26/14
to cube...@googlegroups.com
Thanks! I love the idea of a really simple game based on physically rotating the cube. Your labyrinth thought made me think of Marble Madness, but that might be hard with 8x8 surface ;-)

g.
Reply all
Reply to author
Forward
0 new messages