igendel 27 Posted January 27, 2013 Share Posted January 27, 2013 Hi all, Just to show off a little something I did It's an LCD display of a "ball" rolling around on a spotted surface, and bouncing from the boundries. The direction and speed of rolling is determined by the tilt of the entire setup. The hardware is a Nokia 5110 LCD breakout and a cheap 3-axis accelerometer breakout, both hooked directly to the MSP430 Launchpad. Code was written in Energia. Here's the video: I don't consider the code clean enough to publish, however I'll be happy to answer any questions about it. Happy coding! pine, RobG, cubeberg and 6 others 9 Quote Link to post Share on other sites
bluehash 1,581 Posted January 27, 2013 Share Posted January 27, 2013 The hardware is a Nokia 5110 LCD breakout and a cheap 3-axis accelerometer breakout, both hooked directly to the MSP430 Launchpad. Code was written in Energia. Well done! That's good physics implementation. Is there a preset bounce when you hit an edge? Quote Link to post Share on other sites
cubeberg 540 Posted January 27, 2013 Share Posted January 27, 2013 That's pretty cool! What accelerometer did you use? Quote Link to post Share on other sites
igendel 27 Posted January 27, 2013 Author Share Posted January 27, 2013 Thanks! Is there a preset bounce when you hit an edge? I'm not sure what you mean by "preset"... It's not constant; When the ball crosses a boundry, its current speed on the relevant axis is reversed and halved (e.g. ball.dx = -ball.dx >> 1). What accelerometer did you use? It's based on the MMA7361 chip. The breakout is from China, really cheap (~$4 on ebay). It can work with 5V or 3.3V and has analog outputs. bluehash 1 Quote Link to post Share on other sites
MikeK 0 Posted January 28, 2013 Share Posted January 28, 2013 And if you want that sensor faster than a boat from China, Modern Device carries it for $11. I have one. Quote Link to post Share on other sites
cubeberg 540 Posted January 30, 2013 Share Posted January 30, 2013 Thanks! I'm not sure what you mean by "preset"... It's not constant; When the ball crosses a boundry, its current speed on the relevant axis is reversed and halved (e.g. ball.dx = -ball.dx >> 1). It's based on the MMA7361 chip. The breakout is from China, really cheap (~$4 on ebay). It can work with 5V or 3.3V and has analog outputs. Awesome - I've actually got all of the pieces. Looking forward to seeing the code. I especially like the bounce - I'm interested to see how you're keeping track of the graphics. Quote Link to post Share on other sites
igendel 27 Posted January 30, 2013 Author Share Posted January 30, 2013 Ah, code cleanup, my least favorite part of development... ;-) I'll try to get to it soon. Quote Link to post Share on other sites
cubeberg 540 Posted January 31, 2013 Share Posted January 31, 2013 People are pretty nice around here - and any code is better than none at all Quote Link to post Share on other sites
igendel 27 Posted January 31, 2013 Author Share Posted January 31, 2013 People are pretty nice around here No doubt. When I get some free time to play with the Launchpad, I'm gonna bug you all big time! ;-) and any code is better than none at all Be careful with what you wish... ok, here goes, attaching the code. RollBall.zip cubeberg, canibalimao and neborkia 3 Quote Link to post Share on other sites
1HzCoder 0 Posted February 1, 2013 Share Posted February 1, 2013 Great , What an easy way to make a tilt display for my 5th wheel. Thanks for sharing, I especially like the bounce too. TomJ Quote Link to post Share on other sites
igendel 27 Posted February 1, 2013 Author Share Posted February 1, 2013 What an easy way to make a tilt display for my 5th wheel. Of course, this code wasn't designed for real-life applications - some calibration, adjustment and common sense are advised! Quote Link to post Share on other sites
username 198 Posted February 3, 2013 Share Posted February 3, 2013 Super cool! would be sweet to see a pong implementation w/ that tilt sensor though I suppose it would be alot more coding work. Mind posting which tilt sensor breakout board you used? Quote Link to post Share on other sites
igendel 27 Posted February 3, 2013 Author Share Posted February 3, 2013 Super cool! would be sweet to see a pong implementation w/ that tilt sensor though I suppose it would be alot more coding work. Mind posting which tilt sensor breakout board you used? I was thinking more along the lines of a basic Breakout game ;-) I don't know if this accelerometer breakout even has a name, it's probably the cheapest on ebay. Like I said somewhere up the comments, is based on the MMA7361 chip, and I guess any analog-output accelerometer with 3.3V input will do the trick just fine. Thanks! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.