Sensor Show "poor man's Wii" game demo
AndreL
Posts: 1,004
·For the upcoming sensor show parallax asked me to put together a demo of something cool. So I took the gamepad, put a 2-axis acclerometer on it, interfaced it to one of the paddle games and presto you have a "poor man's Wii" controller. Attached is a pic.
Anyway, I thought that it was such a fun and easy project, everyone should upgrade their controllers with the memsic 2125, its non-invasive and gives you all kinds of cool play options. In this case, I made it so when you twist the paddle left and right or roll it around the +Z out of your body, it moves the paddle left and right. Its a lot of fun, was playing till 6:00am this morning.
Just a few lines of code to interface the driver that Beau wrote to any game.
Of course, general filtering/smoothing would help a bit, and a derivative filter would·be nice so when you jerk the controller it can indicate a "throw ball". But, anyway, fun stuff. Let's see a whole slew of "gesture" games!·
Andre'
Anyway, I thought that it was such a fun and easy project, everyone should upgrade their controllers with the memsic 2125, its non-invasive and gives you all kinds of cool play options. In this case, I made it so when you twist the paddle left and right or roll it around the +Z out of your body, it moves the paddle left and right. Its a lot of fun, was playing till 6:00am this morning.
Just a few lines of code to interface the driver that Beau wrote to any game.
' initialize m2125 (hold your breath, don't move) acc.start(x_pin,y_pin) 'start memsic 2125 waitcnt(clkfreq/10 + cnt) 'wait for things to settle acc.setlevel 'assume at startup that the 2125 is level ... in the main line of game ' get accelerometer status raw := acc.ro 'Get raw value for acceleration mg := raw / clk_scale 'convert raw acceleration value to mg's deg := acc.theta >> 19 'scale 32-bit value to a 13-bit value dx := ((mg*SinCos(COS, deg)) ~> 18) dy := ((mg*SinCos(SIN, deg)) ~> 18) ' move player with accelerometer player_x += (dy ~> 6)
Of course, general filtering/smoothing would help a bit, and a derivative filter would·be nice so when you jerk the controller it can indicate a "throw ball". But, anyway, fun stuff. Let's see a whole slew of "gesture" games!·
Andre'
Comments
Hmm, adding that to xracer would be a pretty sweet to give it analog control.
Post Edited (JT Cook) : 6/7/2007 3:11:46 AM GMT
Andre'
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Lewis [noparse][[/noparse]m80] -