Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

Use the accelerometer as a joystick

Forum for scripts, utilities like TPFanControl, IBM-ECW, 2-finger scrolling, etc.
Post Reply
Message
Author
thinkpadrobert
Posts: 21
Joined: Mon May 10, 2010 8:29 pm
Location: australia, perth, wa

Use the accelerometer as a joystick

#1 Post by thinkpadrobert » Sun Aug 22, 2010 11:57 pm

I've written a program that sends accelerometer data to ppjoy virtual joystick 1. It lets you control games by tilting your thinkpad.

You'll need to download and set up ppjoy (google it) - I used version 0.8.4.5 on win 7.

----------------------------------------
UPDATE (1 Feb 2015): I am still around. I have just updated my aged by still wonderful x61 tablet to an SSD and have installed Windows 8.1 64 bit. The code I wrote before still works - no 64 bit recompile was required but you do have to install the 64 bit version of ppjoy. This can be tricky to find. You must have Lenovo Airbag Protection (Thinkvantage active protection system) installed and enabled.

Here are the links:
My aps2ppjoy program:
https://drive.google.com/file/d/0B_NNBQ ... sp=sharing

Same thing with ppjoy included in the zip:
https://drive.google.com/file/d/0B_NNBQ ... sp=sharing

Please leave a post here if you download and use my program. Thanks!
----------------------------------------
My files are here:
http://rapidshare.com/files/414368643/aps_ppjoy.zip

In the .zip file, there's an exe called aps2ppjoy.exe that will send the data to ppjoy. It comes up as a blank console window. To check if it's working, calibrate the ppjoy virtual joystick (must be number 1!) using the windows joystick calibration tool. Try looking/searching for gamepad in the control panel.

It works - but it's dirty. Uses about 10% of CPU on my x61 tablet. Until someone with more knowledge than me can write a proper HID driver for the accelerometer, it's the best we've got.

Enjoy!

UPDATE: I've modified the code to get cpu usage <1%, but since nobody's download or posted, I can't be bothered to put it in rapidshare. If you want it, PM me.

UPDATE: I've had a few PMs now, so here's the link
http://rapidshare.com/files/418231223/a ... _sleep.exe

I'm not a pro and it tickles me pink to know that people are using my work, so please post and let me know how you go.
Last edited by thinkpadrobert on Sat Jan 31, 2015 11:46 am, edited 6 times in total.

Daniel Bakker
Freshman Member
Posts: 64
Joined: Wed Dec 23, 2009 5:55 am
Location: Hauwert, Netherlands

Re: Use the accelerometer as a joystick

#2 Post by Daniel Bakker » Sun Dec 19, 2010 3:47 am

sounds very good! can I get the files for this new version?

ReCreate
Freshman Member
Posts: 74
Joined: Wed Dec 29, 2010 12:16 am
Location: UK

Re: Use the accelerometer as a joystick

#3 Post by ReCreate » Wed Dec 29, 2010 1:10 am

I found this in a google search for "thinkpad accelerometer joystick". I just had to register to say this is just what i wanted to find. :D It works perfectly with my Thinkpad X41 Tablet that I had gotten for christmas.
Proud owner of: IBM A22M, IBM R30, IBM X41T, IBM X60, Lenovo T400, Lenovo X200S ... and Texas Instruments Extensa 512 :)

thinkpadrobert
Posts: 21
Joined: Mon May 10, 2010 8:29 pm
Location: australia, perth, wa

Re: Use the accelerometer as a joystick

#4 Post by thinkpadrobert » Wed Jan 12, 2011 1:31 am

Thanks for posting! It's good to know you're enjoying it.

RoxyRose
Sophomore Member
Posts: 199
Joined: Tue May 30, 2006 6:42 pm
Location: New York

Re: Use the accelerometer as a joystick

#5 Post by RoxyRose » Sat Jan 29, 2011 11:00 am

I set this up on my x60 and it is working well. Thanks! But I don't know what to use it for...what games would you suggest? I got the alternative, the sdl dll and used that with neverball but honestly it was very hard to control...I think yours would be much better, but most indie games don't allow for joysticks. Even the game I really wanted to play, Labyrinth, doesn't either. I tried the joystick to mouse program with your virtual joystick and I swear I almost broke the computer. LOL

kaede
Freshman Member
Posts: 81
Joined: Tue Nov 27, 2007 6:06 am
Location: Singapore

Use the accelerometer as a joystick

#6 Post by kaede » Sat Jan 29, 2011 11:16 am

theres one game about controlling penguin in a downhill ski resort. but i forgot the title. try find it at youtube

Harryc
Moderator Emeritus
Moderator Emeritus
Posts: 13228
Joined: Thu Apr 12, 2007 8:23 am
Location: Upstate New York

Re: Use the accelerometer as a joystick

#7 Post by Harryc » Sat Jan 29, 2011 11:57 am

kaede wrote:theres one game about controlling penguin in a downhill ski resort. but i forgot the title. try find it at youtube
http://tuxracer.sourceforge.net/

Daniel Bakker
Freshman Member
Posts: 64
Joined: Wed Dec 23, 2009 5:55 am
Location: Hauwert, Netherlands

Re: Use the accelerometer as a joystick

#8 Post by Daniel Bakker » Mon Jan 31, 2011 10:42 am

I've tried it on my new X201 Tablet, but unfortunately, it doesn't work. according to one of the test programs, the axis value is always at maximum when I turn on the accelero. I think I know the problem, I'm using 64 bit windows 7. my T400 with win7 32 bit works flawless.
If anybody has got a solution for this, I'd love to hear it!

ReCreate
Freshman Member
Posts: 74
Joined: Wed Dec 29, 2010 12:16 am
Location: UK

Re: Use the accelerometer as a joystick

#9 Post by ReCreate » Mon Jan 31, 2011 1:38 pm

It seems to be incompatible with x64. I'm not sure how it was done or how it works, but i think the method needed for getting the accelerometer data is different in x64, that or maybe he needs to compile an x64 executable to run natively? *shrugs*
Proud owner of: IBM A22M, IBM R30, IBM X41T, IBM X60, Lenovo T400, Lenovo X200S ... and Texas Instruments Extensa 512 :)

RoxyRose
Sophomore Member
Posts: 199
Joined: Tue May 30, 2006 6:42 pm
Location: New York

Re: Use the accelerometer as a joystick

#10 Post by RoxyRose » Tue Feb 01, 2011 5:14 pm

kaede wrote:theres one game about controlling penguin in a downhill ski resort. but i forgot the title. try find it at youtube
I've tried tuxracer as well as neverball and I have just download blazetris. But again, these are modified sdl games and they don't need this joystick software. Anyone know of real games that I can use this joystick program for?

ReCreate
Freshman Member
Posts: 74
Joined: Wed Dec 29, 2010 12:16 am
Location: UK

Re: Use the accelerometer as a joystick

#11 Post by ReCreate » Fri Feb 11, 2011 11:56 am

It's kind of fun to play with. But to be honest. It isn't ideal for any sort of games or anything. It's a laptop/tabletPC, not a handheld device.
Proud owner of: IBM A22M, IBM R30, IBM X41T, IBM X60, Lenovo T400, Lenovo X200S ... and Texas Instruments Extensa 512 :)

thinkpadrobert
Posts: 21
Joined: Mon May 10, 2010 8:29 pm
Location: australia, perth, wa

Re: Use the accelerometer as a joystick

#12 Post by thinkpadrobert » Fri Mar 11, 2011 9:35 am

I haven't tried to run it on an x64 OS, and I compiled it in a 32bit OS, so that would explain your problems. I've used it with project 64 to play episode 1 pod racer. It's pretty hard work though! You could always use it to turn your computer into an etch-a-sketch or a midi controller. I don't run x64 so have no plans to recompile it, but may do so in the near future. I'll supply the source to someone who can compile in x64 though.

ozzymud
Senior Member
Senior Member
Posts: 590
Joined: Sun Apr 03, 2011 3:38 pm
Location: Klamath Falls, OR

Re: Use the accelerometer as a joystick

#13 Post by ozzymud » Mon May 16, 2011 10:47 am

For a real experience, use your Wii bluetooth devices on PC's... controller, balance board, etc... google for "Wii controller PC"

The coolest usefull thing ive seen the accellerometer in IBM's used for is in linux to switch virtual displays, by "knocking" the laptop left or right... 1 TAP--> 2 TAP --> 3 TAP <-- 2 or locking/unlocking it with a specific "knock" sequence...

http://www.ibm.com/developerworks/linux ... index.html

http://www.ibm.com/developerworks/opens ... xthinkpad/

or use for screen rotation...

http://www.thinkwiki.org/wiki/Using_hda ... n_rotation
(2)701C,(1)760EL,(6)760XL,(1)760XD
(4)CD Drives (5)int floppies (3)ext floppy (4)2.1GB
(10)CF/IDE w/2 or 4GB 133x CF (1)760XL restore CD
(1)Belkin USB 2.0 32bit Cardbus (2)WPC54G(S) Wifi Cardbus
(1)Belkin F5D5020 NIC (1)Giga-Byte GN-WLM01 Wifi
(1)Backpack CD (1) Xircom REM56G-10 + misc

thinkpadrobert
Posts: 21
Joined: Mon May 10, 2010 8:29 pm
Location: australia, perth, wa

Re: Use the accelerometer as a joystick

#14 Post by thinkpadrobert » Wed Apr 04, 2012 4:56 am

Rapidshare tells me they are deleting the file because it's not been downloaded too often. If anyone still wants the binary or the source, please contact me by replying to this post. I check here every so often.

ReCreate
Freshman Member
Posts: 74
Joined: Wed Dec 29, 2010 12:16 am
Location: UK

Re: Use the accelerometer as a joystick

#15 Post by ReCreate » Wed Apr 04, 2012 4:50 pm

thinkpadrobert wrote:Rapidshare tells me they are deleting the file because it's not been downloaded too often. If anyone still wants the binary or the source, please contact me by replying to this post. I check here every so often.
I could upload it to a number of mirrors. One of which is my own and will remain up for at least another year (had it for 4 years so far)
Proud owner of: IBM A22M, IBM R30, IBM X41T, IBM X60, Lenovo T400, Lenovo X200S ... and Texas Instruments Extensa 512 :)

thinkpadrobert
Posts: 21
Joined: Mon May 10, 2010 8:29 pm
Location: australia, perth, wa

Re: Use the accelerometer as a joystick

#16 Post by thinkpadrobert » Tue Feb 10, 2015 4:55 pm

See original post for updated information re 64 bit and new download location.

liuzhanqiu
Posts: 1
Joined: Mon Dec 08, 2014 8:23 pm
Location: Lexington, KY

Re: Use the accelerometer as a joystick

#17 Post by liuzhanqiu » Tue Aug 02, 2016 10:38 am

First of all, thank you very much for your share.

I have tested it with my x230t windows 10 64 bit (Version 1511 OS Build: 10586.104). Unforunately it didn't work.

The measurements of my accelerometer are physically performed by an Analog Devices ADXL320 accelerometer chip, managed by the embedded controller (probably Renesas H8S).

Thinkvantage active protection system is installed and enabled with the process "TpShocks.exe" running. The tilting of my laptop was shown in the properties interface.

The installation of PPJoySetup-0.8.4.6 changed the Boot Configuration so that the PPJoy (a test-signed kernel-mode driver) can be loaded. Right now, my OS is under "Test mode". PPJoySetup-0.8.4.6 shared by you is installed after some warnings of "untrusted driver" were confirmed.

But no "joystick" shows up in the "Devices and Printers" or "Device Manager". So no way for me to use windows joystick calibration tool.

In the "Control Panel", only "Parallel Port Joystick (32-bit)" (the configuration utility) shows up. After I ran the "aps2ppjoy.exe", I was trying to mapping "ppjoy virtual joystick 1" with the configuration utility. When I press "Scan", no input was detected. "ppjoy test.exe" didn't work, too.

Besides, about 10% of CPU was used when "aps2ppjoy.exe" was running, which is clearly not your case....

So what is the reason aps2ppjoy was not working and no "joystick" device show up? "Test mode"?

And how can I install PPJoySetup under normal mode of win 10 64 bit?

I was wondering if you could help me with that.

Last, thank you for your great work again!

Krissharm
Posts: 16
Joined: Sat Sep 14, 2019 8:03 am
Location: BIRMINGHAM, UK

Re: Use the accelerometer as a joystick

#18 Post by Krissharm » Fri Jun 26, 2020 5:31 am

Not used this... but this is totally why thinkpad users are so great. what a great use or hack of hardware. Brilliant.
X230 IPS 16GB RAM, 1TB Samsung (x220 chassis, keyboard & palmrest) SSD MX18 Linux
X201s 8GB RAM, Samsung SSD MX18 Linux x200s screen

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “ThinkPad Utility Work Area”

Who is online

Users browsing this forum: No registered users and 19 guests