#58055 - KeithE - Thu Oct 20, 2005 2:35 pm
I have recently made a tri-axis accelerometer that plugs into the link port of the GBA, and I'm considering making a bunch more of them for anybody who wants one. The accelerometer senses motion in any direction, so it can be used to make motion and tilt sensitive games. It uses a similar accelerometer to the one that is in the apple powerbooks for hard drive protection.
The way it works is the software on a flash cart sets puts the link port into general purpose mode, then communicates with the accelerometer using SPI (Serial Peripheral Interface). The accelerometer gets power from the link port so it doesn't use any batteries.
The first game I used the accelerometer for was a modified version of Marioballs. You just tilt the GBA in the direction you want to shoot the ball. Nicolas, the Marioballs creator, was very excited about this modification to the game. I have also made some other demos that use the accelerometer for menu scrolling, rolling a ball around the screen, a virtual pendulum that responds to your motion, keeping the screen level as the GBA is rotated, and so on. I'm new to GBA programming, so I haven't made any full motion sensitive games yet, but I'm hoping that some of you want to.
I think one really cool use would be a driving game where you hold the GBA like a steering wheel, and turn it to control your car or motorcycle. As you turn it, the screen image would rotate in the opposite direction so the road always appeared level. Another use would be scrolling through a map by tilting, and zooming in and out by moving the GBA towards you or away from you. Motion sensing would really add a new dimension to those skateboarding, bmx, and snowboarding games. Even first person shooters could use it - tilt to control the direction you are looking. And it would certainly be useful for flight simulators.
Anyway, I'm considering making some more of these, but I need to know if there is interest before I spend the money to have them made. If you would be interested in purchasing one for $25, let me know. If there is enough interest (at least 50), I'll probably get some more made. It will come in a hard plastic case and will fit securely into the link port. I will also make the C code for communicating with the accelerometer available. I'm not asking for a commitment, just if you think you would buy one if they were available.
I'm very excited about this, and I really hope there is enough interest. This could revolutionize handheld game development by giving motion sensing capabilities to everyone.
Keith
#62708 - Slosha - Sun Dec 04, 2005 8:20 pm
that sounds extremely cool.... how bout we jsut take our gba/nds and just make it the revolution controller before it comes out....lol
#62757 - OogyBoogy - Mon Dec 05, 2005 2:06 pm
Just imagine Spindizzy with controls like that... totaly awesome.
_________________
OogyBoogy
#62768 - knight0fdragon - Mon Dec 05, 2005 3:10 pm
hell play super monkey balls the way it should be played, brings back the good ol day of kirby tilt n tumble
#62888 - MrD - Tue Dec 06, 2005 6:54 pm
Spindizzy! Now there's somebody with their head on straight!
_________________
Not active on this forum. For Lemmings DS help see its website.
#63008 - KeithE - Wed Dec 07, 2005 8:33 pm
Cool, I'm glad to hear there is interest in this. Rolling ball games are just the beginning. The most recent application I made with the accelerometer was a magic 8 ball for the GBA. You flip it over, then turn it back right side up and the purple triangle with a message comes "floating" to the surface. It is very nostalgic.
This piece of hardware will only work with homebrew games. Unfortunately, you can't just use it for existing games because they don't have any method for communicationg with the accelerometer.
It also doesn't have to be used only for gaming. It could be used to make a pedometer, digital level, or even a performance meter for your car like the g-tech pro.
Lets hear some more wild ideas!
#63029 - ScottLininger - Wed Dec 07, 2005 11:54 pm
I would buy one for $25.
-Scott
#63087 - Crs - Thu Dec 08, 2005 4:31 pm
Wow that sounds fantastic!!, how much would you charge for one? (and shipping costs to England)
[edit] sorry I didnt see you stated $25, thats very reasonable and I'm definately interested... how much for post to UK? [/edit]
A few more questions if you dont mind? I have a game that is extremely close to completion and this could be a great addition.
Is it easy enough to code for? any examples?
Do you have pics, Im interested in how it looks :)
and finally is the motion sensor analogue? - can it be moved more for a different result or does it just indicate direction is - / +
Thanks
Chris.
Last edited by Crs on Thu Dec 08, 2005 4:47 pm; edited 2 times in total
#63089 - Dwedit - Thu Dec 08, 2005 4:34 pm
Any way to manually poll a wario ware twisted cartridge to get similar results?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#63091 - KeithE - Thu Dec 08, 2005 4:51 pm
My plan is to charge $25 USD once I order some cheap plastic cases, solderable link port connectors, and get a custom PCB fabricated to fit.
So far I've been cutting apart link cables and soldering the wires to the correct places on an accelerometer evaluation board. This takes a while and I wasn't planning on selling these prototypes, but I would be willing to sell some for $50 USD plus shipping. Send me a PM if you are interested.
Here is a link to a picture of the PCB that I'm using currently:
http://kionix.com/Downloads/KXP74%20Evaluation%20Board.pdf
And here is a link to the case I'm going to be using in the future:
http://xinga.com/shop/show.php?product=GA5005
The code is really easy. I've written some functions to turn the accelerometer on and read the 3 axes of acceleration. I also wrote some functions to calibrate the sensor if you want to get very precise.
For example, the function to read the X acceleration works like this:
Code: |
Xaccel = readX(values); |
That code returns the X acceleration in g's (1 g is 9.8 m/s^2). "values" is a structure with the sensor parameters (0g offset and sensitivity).
The range of the sensor is +/- 2 g's, and the resolution is around 1 milli-g. It is a 12 bit digital sensor.
#63120 - Crs - Thu Dec 08, 2005 9:20 pm
Keith, thanks for the reply, that sums it all up nicely. :)
is it possible to work out an ETA on the cased design from the go-ahead?
If you need more feedback of interested buyers, perhaps you could make a poll on the news forum.. reason I say this is because I only visted this forum by chance today otherwise I wouldn't have even noticed this post.
Like you said it could "revolutionize handheld game development", wow, great stuff! I can barely wait..
Chris.
#63121 - thegamefreak0134 - Thu Dec 08, 2005 9:34 pm
You said it could be used for rotation and such? I'm not sure I follow how the code values returned would be useful... Would it be possible to get a starting position (like for a game start calibration) and then use that value in conjunction with the current value to determine the way the GBA has been tilted? (I'm shooting for ease of code here) Or does it simply tell you that the GBA is moving and leave it up to you to figure out what to do?
_________________
What if the hokey-pokey really is what it's all about?
[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]
#63126 - KeithE - Thu Dec 08, 2005 9:52 pm
It will be at least 2 or 3 months before I have the version with the plastic case.
As for how to use the accelerometers - some things are simple, and others are complicated.
The accelerometer will tell you the acceleration that it senses. Gravity is a constant (roughly) acceleration of 9.8 meters per second squared. The acceleration on a particular axis (in g's) is equal to the sine of the angle of that axis from the horizon. So to get the angle, you take the inverse sine of the acceleration. The accelerometer will sense acceleration from moving it around also, so you have to be holding it roughly stationary for this to work.
So, you need to know a little bit of physics to use the accelerometers, but it is really not too bad. Once more and more people start using them for gaming, code will be posted and ideas will be exchanged.
#63127 - thegamefreak0134 - Thu Dec 08, 2005 10:04 pm
Oh, I see. So, by tilting the GBA, the gravitational pull would start to affect the X and Z planes as well as the Y? And at the same time the Y plane would be reduced? This works pretty well. I like it. The only problem I would have is that I do a lot of playing on a bus, and the bumps and jolts really wouldn't help. Oh well. And of course, you could assume (on a gravity standard) that increases or decreases in the acceleration of any plane would be equal to movement left, right, up, and so forth?
Here's a thought: Would it be possible to write a coding function that figured out how it was rotated and how it was moved at the same time? Like, by assuming that gravity would never be more than 9.81 m/s, you could safely assume that it would decrease for rotation and only increase in the act of moving the GBA up? You could also assume that if gravity stayed constant and the other planes were moving, that it was GBA movement and not rotation?
PS: the XYZ thing assumes that (looking forward) X = right to left, Y = up and down, and Z = depth
_________________
What if the hokey-pokey really is what it's all about?
[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]
#63128 - KeithE - Thu Dec 08, 2005 10:13 pm
I think you understand it pretty well. You can calculate the linear acceleration and the rotation angle if you make some assumtions, as you suggested. You can't do it for all cases though, but the nice thing about handheld gaming is that people learn pretty quickly how to move to get the response they want, and hand/eye coordination can correct for some errors in the sensor and the code that interprets the sensor readings.
#70729 - Crs - Wed Feb 08, 2006 12:49 pm
Hi Keith, any updates with the sensor developments?
Thanks
Chris.
#70746 - KeithE - Wed Feb 08, 2006 3:01 pm
I've found a vendor who will make me a custom PCB with a link port connector and put it all in a compact plastic case, but I'm waiting to get approval from my funding source. I'm expecting to have some ready for the general public within 2-3 months.
To encourage the use of motion sensing in handheld games, I've been considering giving these devices to a bunch of people on this forum. In exchange for one of these devices, you would agree to make an open-source application or game using the accelerometer. To decide who to give them to, I was thinking about soliciting ideas for apps or games and picking my favorites. I'll probably give away 10-25 of them.
What do you all think about that?
#70749 - jake2431 - Wed Feb 08, 2006 3:21 pm
That's a great idea! You should start a thread about this in the Announcments forum and ask for experienced programmers to propose ideas, and figure out who to give them to from there.
#70750 - KeithE - Wed Feb 08, 2006 3:24 pm
I will certainly do that once I have the hardware in my hands, or maybe when I place the order for them.
#72587 - MrD - Mon Feb 20, 2006 3:44 am
This is an excellent idea! Very much looking forward to see what happens...
_________________
Not active on this forum. For Lemmings DS help see its website.
#74092 - Crs - Thu Mar 02, 2006 9:55 am
KeithE, that really does sound like a brilliant idea and to add do what Jake said :D
So can you tilt it back and forward as well as left and right?
I can't wait for the release of this!!
Chris.
#74107 - KeithE - Thu Mar 02, 2006 2:59 pm
Chris,
Yes, it senses left/right tilting, back/forth tilting, and up/down motion.
I'm glad to hear that you all are so excited about it. Right now I'm working with the PCB designer/manufacturer to get all the details straightened out, so I should be ordering soon.
I'm just as impatient about it as you guys, so I'm trying to push it along quickly. I'll keep you posted.
Keith
#74125 - Bojangles - Thu Mar 02, 2006 5:15 pm
Hi KeithE,
What about combining this with Natrium's serial device for the NDS?
It's super cool that it works over the GBA link cable, but it would be soooo nice to be able to have this on the DS.
Touch n Tilt screen for the win!
#74127 - KeithE - Thu Mar 02, 2006 5:38 pm
Natrium and I actually are in contact with each other. He's using a dual-axis accelerometer, and I'm trying to convince him to go with the tri-axis that I'm using.
The advantage of a tri-axis over a dual axis is that you can sense motion perpendicular to the system, which is useful for things like jumping, and also for full 3D orientation sensing. A dual axis cant tell you whether it is right side up or upside down, for example because both axes are perpendicular to gravity in both cases.
Also, a tri-axis can be used to sense freefall. This is more useful for devices with hard drives so you can park the hard drive in a fall, but for fun you could make your GBA or DS scream at you when you drop it:)
#74942 - Dan_attacker - Thu Mar 09, 2006 12:40 am
Pretty cool stuff... I'm going to use accelerometers for a UAV project that i'm doing. I never considered using the GBA as the onboard computer, but now I might do that and purchase your device (although I don't know if accelerometers alone will work for my needs).
http://www.freescale.com/files/sensors/doc/app_note/AN3107.pdf
some accelerometer info ^
#77746 - Crs - Sun Apr 02, 2006 9:39 pm
Any monthly updates? :)
Chris.
#77794 - KeithE - Mon Apr 03, 2006 1:11 am
Man, you are impatient :) Actually, it's good to know that you are interested in the progress.
Yes, I am making progress. The circuit boards have been ordered, and the accelerometer chips have been sent to the assembler to be soldered to the circuit boards and put in the plastic case with the link port connector.
If all goes well, I'll have them in my hands in less than a month. When they arrive, I'll post a message in the announcements forum.
I have already found a few people who I will donate a GBAccelerometer to, and I'll be giving away some more to people who who have clever ideas for projects that they will follow through on. For anyone who wants to buy one, they'll be $25 + S/H.
Keith
#78951 - MrD - Mon Apr 10, 2006 9:19 pm
Any idea on s/h to UK?
_________________
Not active on this forum. For Lemmings DS help see its website.
#79088 - KeithE - Tue Apr 11, 2006 3:21 pm
Shipping to the UK would be around $15 using the US postal service, which takes about a week. FedEx or DHL would be more like $50.
#79217 - OogyBoogy - Wed Apr 12, 2006 5:43 am
Can we place orders yet?
_________________
OogyBoogy
#79254 - KeithE - Wed Apr 12, 2006 1:47 pm
You are welcome to order one, but they won't be ready for another few weeks. If you would like, you can PM to let me know that you want one, and I'll let you know when they are ready.
#125631 - Ant6n - Sun Apr 15, 2007 6:41 am
So, its been about a year since the gba accelerometer started, and i wonder what it's done so far. I find the idea very interesting, but are there actually many people who have one of these? i.e. how many did actually buy one of these?
are developers content with its accuracy etc? how far did people push these things, i.e. are they actually so accurate that they could they be used as a mouse or joystick?
#125745 - KeithE - Mon Apr 16, 2007 4:13 pm
I can answer your questions.
Quantity:
at least 11 donated to homebrew developers
50 sold to jandaman.com - at least 30 of them have been sold to customers
25 sold to shop.01media.com
5 sold to metashop-fr.com
Accuracy:
12 bits of resolution - these sensors are very precise. Accuracy out of the box is about +/- 5 degrees of tilt, after calibration accuracy is much better. Read the comments on the GBAccelerometer web site to see what people have to say about it.
Games:
My favorite motion sensing GBA games are Hazardball, MarioBalls Tilt, Loop the Loop Tilt, and SpoutGBA Tilt - all downloadable from the GBAccelerometer web site. The GBAccelerometer can do almost everything the DS Motion Card can do, but since GBA homebrew has become less popular, there are not very many developers interested in creating motion sensing GBA games.
Mouse or Joystick:
Accelerometers are not good for sensing position, so mouse control is unlikely. Joystick could be done, but how would you interface the GBA with a computer when the link port is taken up by the GBAccelerometer?
Any other users of the GBAccelerometer care to comment?
#125763 - Ant6n - Mon Apr 16, 2007 7:33 pm
Quote: |
Mouse or Joystick: ... |
Since the gba doesnt have an analog stick which is used for steering or aiming on consoles, can the accelerometer be used to 'emulate' that behaviour?
#125764 - KeithE - Mon Apr 16, 2007 7:53 pm
Yes, it certainly can.
The difficulty lies in how to convert the measured acceleration signal to a position. The three basic ways to do it are:
1) screen position proportional to measured acceleration
2) screen velocity proportional to measured acceleration
3) screen acceleration proportional to measured acceleration
Method 1 is the most obvious and easiest, and it works pretty well.
A very good implementation would probably consist of mostly method 1, with some filtering, nonlinearity and little bits of method 2 and 3 thrown in to achieve a good "feel". The algorithm for PC mouse motion is not a simple position-position mapping - there is a customizable acceleration term that you can use to change how the movement feels.
#126762 - sonysonic - Thu Apr 26, 2007 12:26 pm
real cool
_________________
max kralstein