So here are the binaries I was talking about in my last post.
You can upload lua scrips to your NDS and run them, all via wireless.
Then you can access the DSerial, sockets, save through dldi, keypads, touchscreen...
Examples included:
Robot.lua: skeleton to access the DSerial
Server.lua: a simple web server in a few lines of code
http://aguaviva.googlepages.com/LuaDSerial.zip
Source code is available upon request.
Sunday, 13 January 2008
Wednesday, 28 November 2007
Sync and Run for NintendoDS (this time using Lua)
I like building robots and lately I'm using a NintendoDS as the brain and DSerial2 which is a device that allows me connect servos and stuff to the NintendoDS.
So far so good, but one quickly realizes that the development cycle is quite a pain in the butt:
1) compile
2) take out the MicroSD from the NDS
3) put it in the MicroSD to SD adapter
4) Put the SD adapter in the reader
5) copy the stuff, eject the SD (right click etc..)
6) put the MicroSD in the NintendoDS
7) run the app
8) repeat if you need to tune the app
So after a few iterations things stop being fun.... so here is what I did!
I compiled lua for nintendo with bindings for libwifi, libfat, some stdio from libnds and dserial. This proggy when run loads and executes fat:/autoexec.lua which in my case this script does the following:
1) downloads from my PC a script called robot.lua
2) executes this script
3) when done waits for a keypress
4) goto 1
The trick is that while the NintendoDS waits for a keypress I can edit the the robot.lua on my PC, so yes, I only need to press a key to update the robots.lua and run it
Just for fun I also wrote a web server so you can control dserial using a webbrowser
I'll be posting the tool soon here....
BTW: There is a bug on the DSerial2 interface and it gets locked up when you update the position of the servos quite fast, I hope Natrium42 has a chance to fix this issue soon.
So far so good, but one quickly realizes that the development cycle is quite a pain in the butt:
1) compile
2) take out the MicroSD from the NDS
3) put it in the MicroSD to SD adapter
4) Put the SD adapter in the reader
5) copy the stuff, eject the SD (right click etc..)
6) put the MicroSD in the NintendoDS
7) run the app
8) repeat if you need to tune the app
So after a few iterations things stop being fun.... so here is what I did!
I compiled lua for nintendo with bindings for libwifi, libfat, some stdio from libnds and dserial. This proggy when run loads and executes fat:/autoexec.lua which in my case this script does the following:
1) downloads from my PC a script called robot.lua
2) executes this script
3) when done waits for a keypress
4) goto 1
The trick is that while the NintendoDS waits for a keypress I can edit the the robot.lua on my PC, so yes, I only need to press a key to update the robots.lua and run it
Just for fun I also wrote a web server so you can control dserial using a webbrowser
I'll be posting the tool soon here....
BTW: There is a bug on the DSerial2 interface and it gets locked up when you update the position of the servos quite fast, I hope Natrium42 has a chance to fix this issue soon.
Tuesday, 31 July 2007
Nintendo DS homebrew under Linux (Ubuntu)
I just bought a Nintendo DS and a SuperCard for homebrew..
And once installing the devkitARM, ndslib, gbalib and the you will ralize that you need ndstool for linux... I haven't find it anywhere but in the cvs source forge repository, so I installed cvs, got the source and here is the binary: ndstool
If you want to compile it yourself these are the magic words you need to type:
cvs -d:pserver:anonymous@devkitpro.cvs.sourceforge.net:/cvsroot/devkitpro login
cvs -z3 -d:pserver:anonymous@devkitpro.cvs.sourceforge.net:/cvsroot/devkitpro co -P tools/nds/ndstool
enjoy!
And once installing the devkitARM, ndslib, gbalib and the you will ralize that you need ndstool for linux... I haven't find it anywhere but in the cvs source forge repository, so I installed cvs, got the source and here is the binary: ndstool
If you want to compile it yourself these are the magic words you need to type:
cvs -d:pserver:anonymous@devkitpro.cvs.sourceforge.net:/cvsroot/devkitpro login
cvs -z3 -d:pserver:anonymous@devkitpro.cvs.sourceforge.net:/cvsroot/devkitpro co -P tools/nds/ndstool
enjoy!
Sunday, 18 March 2007
Symbolic math
I got surprised the first time I saw Mathematica working with symbolic expressions, and since then I always wondered how was that done, so i just went ahead and tried to do a mini Mathematica
So I teached the system a bunch of rules and then its is able simplify, derive and isolate variables (this last one only works on some silly situations)
So, here is the code---> SymbolicMath.zip
I created a system that can learn rules. The rules are read by a simple parser that understands mathematical expressions, and once this is done it can derive, simplify, isolate variables...
For example to teach the system how the number zero works I'd do it this way:der.AddRule( "a*0", "0" )
der.AddRule( "a+0", "a" )
where 'a' represents any expression , another rule for workign with powers:
der.AddRule( "(a^b)*a", "a^(b+1)" )
and to compute the derivative:
der.AddRule( "der(a,a)", "1" )der.AddRule( "der(cos(a),b)", "-sin(a)*der(a,b)" )der.AddRule( "der((a/b),c)", "(der(a,c)*b-a*der(b,c))/(b^2)" )
So I teached the system a bunch of rules and then its is able simplify, derive and isolate variables (this last one only works on some silly situations)
So, here is the code---> SymbolicMath.zip
Sunday, 18 February 2007
Playing with Wavelets
I always wondered how wavelets work so I went ahead and I wrote my own wavelet compressor using python, I did it in 2 days so don't expect much :-) I didn't really read any paper, I did all this with ideas I heard here and there...
here is the code and Lena's tiff -->wavelet.zipAnd these are the images at different levels of detail, sorry I didn't specify the number of coefficients for each image!









here is the code and Lena's tiff -->wavelet.zipAnd these are the images at different levels of detail, sorry I didn't specify the number of coefficients for each image!









Friday, 20 October 2006
Full screen dot matrix scroller using pys60
Have you seen those red dot matrix scrollers? Just for fun I coded an app to display a message in teh same way on your phone's display...
I heard some people are using it to pass funny messages in meetings....
have fun!
scroller.zip
I heard some people are using it to pass funny messages in meetings....
have fun!
scroller.zip
Wednesday, 18 October 2006
Use your nokia phone as a wireless spy camera
Now anyone can kick James Bond's ass with this little app. From your computer, and over bluetooth, you can tell your phone to take a picture and send it to you.
In order to get this working just use the "sync and run" to run these two commands on hte pc side:
In order to get this working just use the "sync and run" to run these two commands on hte pc side:
control.py -x "import camera;im = camera.take_photo();im.save('c:\\pic.jpg')"
control.py -g 'c:\\pic.jpg' mypic.jpg
have fun!
Subscribe to:
Posts (Atom)