tag:blogger.com,1999:blog-550021620398023619.post7449915016290959499..comments2010-02-28T08:50:42.628+05:30Comments on iFiddling: Use the Mac's accelerometer in the iPhone SimulatorKaran Vasudevahttp://www.blogger.com/profile/02985733443651962905noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-550021620398023619.post-17862842376653743652010-02-02T19:39:31.914+05:302010-02-02T19:39:31.914+05:30Very, very helpful. Was really wondering how to si...Very, very helpful. Was really wondering how to simulate the accelerometer on just a MacBook. Thanks.Larryhttps://www.blogger.com/profile/10081543924948897705noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-24953318381443421592010-02-01T08:31:55.207+05:302010-02-01T08:31:55.207+05:30Thanks, Ben. I'll remember to quote code in a ...Thanks, Ben. I'll remember to quote code in a pre-formatted span in future.Karan Vasudevahttps://www.blogger.com/profile/02985733443651962905noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-62454226211538575052010-01-31T07:04:35.913+05:302010-01-31T07:04:35.913+05:30blogger killed the formatting in my post. The form...blogger killed the formatting in my post. The format in the makefiles needs to be:<br /><br />all:<br />[tab] blablablaBen Weisshttps://www.blogger.com/profile/11717123765574037939noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-73042911497938911562010-01-31T07:03:20.388+05:302010-01-31T07:03:20.388+05:30This comment has been removed by the author.Ben Weisshttps://www.blogger.com/profile/11717123765574037939noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-26643070123488849832010-01-31T07:01:43.010+05:302010-01-31T07:01:43.010+05:30Okay, I finally got this working after a bit of fi...Okay, I finally got this working after a bit of fiddling.<br /><br />Copying and pasting the python code into a text file resulted in some inadvertent hard-spaces (option-space). You can search and replace these hard-space characters with ordinary spaces, and that fixes the non-ASCII character issue. I also had to do some re-indenting to make the python file run correctly.<br /><br />Then I had to tweak the makefiles because they were formatted:<br /><br />all: blablabla<br /><br />when they need to be (with a carriage return and a tab):<br /><br />all:<br /> blablabla<br /><br />At this point the makefile seems to build things correctly, although I still get the following:<br /><br />make -C unimotion<br />../Frameworks/libUniMotion.dylib ../bin/libUniMotion.dylib<br />../Frameworks/libUniMotion.dylib: ../Frameworks/libUniMotion.dylib: cannot execute binary file<br />make[1]: *** [all] Error 126<br />make: *** [sub-unimotion] Error 2<br /><br />Anyway, then I put sendaccsim.py in the 'bin' directory next to motion and libUniMotion.dylib, navigate to that directory, and run the script as described. I temporarily commented in the printf in the python script, to verify that it was running correctly. I also applied JMathews' changes.<br /><br />Then I downloaded the linked accelerator-simulator code, and spliced it into my iPhone application project as described. Then run the iPhone app in the simulator. Voila, it worked!Ben Weisshttps://www.blogger.com/profile/11717123765574037939noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-28326620447796162482010-01-16T22:32:16.540+05:302010-01-16T22:32:16.540+05:30This comment has been removed by a blog administrator.Make Money Onlinehttps://www.blogger.com/profile/04531684505906844965noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-8161421923500219692009-12-05T09:01:20.796+05:302009-12-05T09:01:20.796+05:30Hello Mr Karan Vasudeva,
I am also looking to do t...Hello Mr Karan Vasudeva,<br />I am also looking to do this on my mac. Unfortunately I am very new to Mac. I tried to copy and save the python code and try to run it, but errors are appearing.<br /><br />Here is what I did:<br />1. Downloaded the unimotion and extracted to a folder.<br />2. Run Terminal and type make at the unimotion folder (ie, cd etc etc etc, then "make").<br />3. After it creates a binary folder (bin), i copy the sendaccsim.py file into the motion folder. The type ./motion -f 17 | python sendaccsim.py and enter<br /><br />But an error came up:<br />File "sendaccsim.py", line 12<br />SyntaxError: Non-ASCII character '\xc2' in file sendaccsim.py on line 12, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details<br /><br />What is wrong? Am I missing something?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-40279057641802171262009-08-25T10:09:18.574+05:302009-08-25T10:09:18.574+05:30I guess so. You could try the code here:
http://...I guess so. You could try the code here:<br /><br /> http://www.steike.com/code/multitouch/<br /><br />I haven't been able to run it myself because my MacBook doesn't have a multitouch trackpad. I tried!Karan Vasudevahttps://www.blogger.com/profile/02985733443651962905noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-87653951913790301022009-08-24T22:27:57.153+05:302009-08-24T22:27:57.153+05:30Will it be possible to use macbook's multi-tou...Will it be possible to use macbook's multi-touch pad to send multi-touch event to iphone simulator?Anonymoushttps://www.blogger.com/profile/15014992858637755434noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-77682641722503904102009-06-20T07:19:52.638+05:302009-06-20T07:19:52.638+05:30Yes, I agree that that would make more sense!Yes, I agree that that would make more sense!Karan Vasudevahttps://www.blogger.com/profile/02985733443651962905noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-14725585459968496582009-06-18T14:05:21.467+05:302009-06-18T14:05:21.467+05:30It seems unnecessary that this script be sending a...It seems unnecessary that this script be sending anything at all on the network let alone broadcasting.<br /><br />If you make these changes the "traffic" won't leave the local machine.<br /><br />#sock.bind(('',0))<br />sock.bind(('',10522))<br />#sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)<br /><br /># sock.sendto(accdata, ('{broadcast}', 10552))<br /> sock.sendto(accdata, ('localhost', 10552))JMathewshttps://www.blogger.com/profile/14507925763700098098noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-48478625091166769972009-06-12T15:09:52.037+05:302009-06-12T15:09:52.037+05:30:) I guess you could reduce the accelerometer samp...:) I guess you could reduce the accelerometer sampling rate.Karan Vasudevahttps://www.blogger.com/profile/02985733443651962905noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-41588824756227398472009-06-12T10:59:44.530+05:302009-06-12T10:59:44.530+05:30The other thing that's a little strange is how...The other thing that's a little strange is how much network activity this creates. It reminds me of the Doom 1.0 days, lots of broadcasting all over the network!JMathewshttps://www.blogger.com/profile/14507925763700098098noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-78994022024576868912009-06-12T06:34:05.664+05:302009-06-12T06:34:05.664+05:30This is a very cool trick thanks. But a note, thi...This is a very cool trick thanks. But a note, this only works if the simulated orientation of the phone is portrait. For example, if you're in landscape then X & Y on the accelerometer are swapped.JMathewshttps://www.blogger.com/profile/14507925763700098098noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-49467227304555483302009-05-13T18:39:00.000+05:302009-05-13T18:39:00.000+05:30We mentioned this method in our IAQ (Infrequently ...We mentioned this method in our IAQ (Infrequently Answered Questions) on our website: <A HREF="http://www.appalbum.com/developers/iaq.html#q5" REL="nofollow">http://www.appalbum.com/developers/iaq.html#q5</A>Unknownhttps://www.blogger.com/profile/00870524977399656830noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-5753506911950714522009-05-05T10:33:00.000+05:302009-05-05T10:33:00.000+05:30I am also facing the problem of shift of choti-I m...I am also facing the problem of shift of choti-I matra one position right than its normal position on an linux based ebmedded board with Firefox 3.0.1. Any suggestions will be greatly appreciated.Unknownhttps://www.blogger.com/profile/13019730883233719459noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-48460945187790135472009-04-01T13:53:00.000+05:302009-04-01T13:53:00.000+05:30Fantastic - this was just what I needed to start d...Fantastic - this was just what I needed to start development before getting a developer license. Thanks!daveolahttps://www.blogger.com/profile/18059839144977699650noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-39005971968350314442009-03-11T19:29:00.000+05:302009-03-11T19:29:00.000+05:30'calibrate' will run in a loop, printing out curre...'calibrate' will run in a loop, printing out current orientation values to stdout and expecting scale and offset calibration values on stdin in every iteration.<BR/><BR/>For the Mac lying on a surface as horizontal as you can arrange, you should expect the three values in the f: field to be as close as possible to 0.00, 0.00 and -1.00 respectively, as you tweak calibration values. <BR/><BR/>When you exit, these values are saved to ~/Library/Preferences/com.ramsayl.UniMotion.plist (I think) and subsequently are picked up by 'motion'.Karan Vasudevahttps://www.blogger.com/profile/02985733443651962905noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-64957200997051602472009-03-11T09:58:00.000+05:302009-03-11T09:58:00.000+05:30When you say you needed to run calibrate, what exa...When you say you needed to run calibrate, what exactly did you do with it? I can't understand what to do with it, and I'm not able to get it running on my machine<BR/><BR/>Thanks for posting this up.tomjensenhttps://www.blogger.com/profile/12724783204383883679noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-69501911619213324352009-01-20T19:09:00.000+05:302009-01-20T19:09:00.000+05:30haha.. I don't know how you serve your guests tea,...haha.. I don't know how you serve your guests tea, but hopefully it's not on them :)<BR/><BR/>Nice post... look forward to reading more.Unknownhttps://www.blogger.com/profile/10889247329065214022noreply@blogger.comtag:blogger.com,1999:blog-550021620398023619.post-89639403180484982742009-01-15T01:50:00.000+05:302009-01-15T01:50:00.000+05:30I thought you would fiddle with it, when did u dec...I thought you would fiddle with it, when did u decide to poke and peek ;)ABhttps://www.blogger.com/profile/14118677483039002034noreply@blogger.com