iPodHacking Community
Home Forum Wiki Themes Register Members List Mark Forums Read
 

Go Back   iPodHacking Community > iPod Touch/iPhone > Hacks/Customization

Sponsored Links

Notices

Hacks/Customization Find the latest hacks/customizations here.

Reply
 
LinkBack Thread Tools
Old 01-05-2008   #1
Member
 

Join Date: Dec 2007
Posts: 7
ichaelmay8 is on a distinguished road
Send a message via AIM to ichaelmay8
Default Using Accelerometer output to control Computer-Side Applications

Youtube video:

Here's the official writeup:
Quote:
iPod Touch/iPhone Game Controller

>Overview

This hack allows you to obtain accelerometer input from your iPod Touch or iPhone and send it to a local machine. From there, the data can be used to power a game(as I chose) or to show the iPod's orientation graphically. The code itself is mainly PHP and JavaScript, with some HTML.

>How Does this Work?

In the iPod's browser(safari), Apple included some javascript events. One such event is window.orientation. This returns either 0, 90, or -90. The home button is at the bottom, to the left, and to the right, respectively.

This value is written to a cookie, which is then read by the PHP code. The PHP code then writes this value to a text file, which is then read by various applications.

Frankly, it's a couple of dirty hacks. The php file refreshes once a second to reread the cookie.

>Which Files do What?

ipodtocompy.php contains the PHP code and HTML stuff. It handles reading the cookie set by ipodtocompy.js. It also prints this value to a server-side file. ipodtocompy.js gets the input from the iPod and writes the cookie.

>How Effective is it?

It works pretty well. There's some noticeable lag though. There's about a second, maybe 1.5 seconds of delay between rotating the touch and having one of the computer-based applications perform an action.

What did you have to do to get this to work?

I had to set up a Local Area Network with a wi-fi connection. I installed apache 2.2.3 and PHP 5.2.5 on my computer which is connected to this LAN.

>How can I try this?

You can grab the code from here##. You have to set up a LAN and install apache and PHP. Links and stuff on that are in the code archive.

>What's in that archive?

It's a zip file(for universality's sake). It contains readme.txt, ipodtocompy.js, ipodtocompy.php, tiles.exe, and rawread.exe. Tiles and rawread are two utilities I wrote to test the output of the PHP script. Tiles is the game depicted in the video #here#. Rawread directly reads in the values from the PHP script.

>What if I want more information?

Then drop me an email at ichaelmay8@yahoo.com. I'll be glad to answer any questions you've got.

>How long did this take?

It took a couple hours in the evening, and most of the following day to write. I think that's pretty good for a seventeen year old whose primary language is C.

>>iPod Touch, iPod, iPhone, and Apple are trademarks of Apple, Inc.
Here's the link to the code and instructions: http://www.freewebs.com/ichaelmay8/ipodtocompy.zip


__________________
Want to mod the graphics, sounds, and strings of the iPod Games? Check out my site: http://www.freewebs.com/ichaelmay8
ichaelmay8 is offline   Reply With Quote
Sponsored Links
Old 01-13-2008   #2
Member
 

Join Date: Dec 2007
Posts: 7
ichaelmay8 is on a distinguished road
Send a message via AIM to ichaelmay8
Default

Sorry about the double post. Feel free to merge the posts if needed.

I was able to get the iPod Touch to control your mouse location/clicks. Here's the youtube video:
__________________
Want to mod the graphics, sounds, and strings of the iPod Games? Check out my site: http://www.freewebs.com/ichaelmay8
ichaelmay8 is offline   Reply With Quote
Old 01-13-2008   #3
H3X
Super Mod
 
H3X's Avatar
 

Join Date: Dec 2007
Posts: 216
H3X is on a distinguished road
Default

Wow, that's awesome.

I might try it soon.
H3X is offline   Reply With Quote
Old 01-13-2008   #4
Feirce Revolution!
 
RedBooster's Avatar
 

Join Date: Dec 2007
Location: Canada
Age: 17
Posts: 124
RedBooster is on a distinguished road
Default

Yea, thats really awesome... I managed to get my ipot to control a few applications, and i'm still trying to control my mouse clicks.. i'll get it eventually.
__________________
Owner of a 16Gb Ipod Touch
Jailbroken 1.1.3
Fav. Apps: TTR, gpSPhone, psx4all
Plus 40+ more apps

Sign up and refer people to get a free ipod touch click here
Only need 8 more referals
RedBooster is offline   Reply With Quote
Old 01-14-2008   #5
fag
 

Join Date: Dec 2007
Posts: 57
I XtiNCt I is on a distinguished road
Default

that is freaking cool. i am gonna try that on my mac later. i think it would probably work, right? same theory basically...
I XtiNCt I is offline   Reply With Quote
Old 01-14-2008   #6
Matthew98
Guest
 

Posts: n/a
Default

This is amazing.

I can't wait to try this on my iPod Touch.
  Reply With Quote
Old 01-24-2008   #7
Member
 

Join Date: Dec 2007
Posts: 7
ichaelmay8 is on a distinguished road
Send a message via AIM to ichaelmay8
Default

Here's the stuff for the desktop control: http://www.freewebs.com/ichaelmay8/i...control1.0.zip

The binaries inside are windows only(sorry, but I included the source for everything). Just like the accelerometer hack, you need to have apache installed.
__________________
Want to mod the graphics, sounds, and strings of the iPod Games? Check out my site: http://www.freewebs.com/ichaelmay8
ichaelmay8 is offline   Reply With Quote
Old 01-25-2008   #8
:ban:
 
DarkWarrior's Avatar
 

Join Date: Dec 2007
Posts: 993
DarkWarrior is on a distinguished road
Default

this is like the Wiimote hacks :p


__________________
Whats up people who remember me? Wanna see where iv been?--> themodshop.net
DarkWarrior is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sponsored Links

New To iPodHacking.com? Need Assistance?

All times are GMT. The time now is 08:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
iPodHacking is a Member of the R9V Network

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62