Revision3.com Shows Schedule Inside Revision3 Store


Go Back   Revision3 Forums > Shows > HAK5

Reply
 
Thread Tools Search this Thread Display Modes

  #1  
Old 04-20-2009, 11:39 PM
blackcow's Avatar
blackcow
Newbie
 
Join Date: Jan 2007
Posts: 6
Status: Offline
Default Remote control RC car with a Linux server.

So I remember hearing that Hak5 is working on a net controlled RC tank so I thought I would share how I did it using a parallel port on my Linux server and some C and PHP. I wrote the client in flash action script. I am sure it is pretty easy to do the same in JavaScript.



I wrote up an article about it and provide all the code and instructions to control the parallel port from the web.
Link

I will be interested to see how Hak5 does it.

Last edited by blackcow : 04-20-2009 at 11:40 PM.
Reply With Quote
  #2  
Old 04-21-2009, 01:00 AM
computoman
 
Posts: n/a
Default

http://pyrorobotics.org/?page=PyroLiveCD
Reply With Quote
  #3  
Old 05-06-2009, 04:27 PM
jimlovell777
Newbie
 
Join Date: May 2009
Posts: 7
Status: Offline
Default

I recently started a similar project, I'm also using Linux and PHP. Here's a link to my project http://letsmakerobots.com/node/6820

Last edited by jimlovell777 : 05-06-2009 at 04:28 PM.
Reply With Quote
  #4  
Old 10-28-2010, 08:00 PM
computoman
 
Posts: n/a
Default

I had forgotten all about this. I have been playing with parallel port interfacing. Wrote my own server software independent of this project. Will go back and look at it again.

Used :
#include <asm/io.h>
instead of
#include <sys/io.h>


Last link no longer works.

Code:
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/io.h>  // should be asm/io.h for some linux variations.

//#include <asm/io.h>
// Didn't work, replaced with sys/io.h


char *binprint( unsigned char x, char *buf )
{
int i;
for( i=0; i<8; i++ )
buf[7-i]=(x&(1<<i))?'1':'0';
buf[8]=0;
return buf;
}

int main( int argc, char *argv[] )
{
char c;
unsigned char val;
char buf[9];
int x;
if( argc<2 )
{
printf("Example usage: ppp 1l 2l 3h 5h 8l\n");
return 2;
}
if( ioperm(888,1,1) )
{
printf("Couldn't find parallel port (888)\n");
return 1;
}
val = inb(888);
printf("old = %s\n",binprint(val,buf));
for( x=1; x<argc; x++ )
if( argv[x][1]!='h' )
val &= ~(1<<(argv[x][0]-'1'));
else
val |= 1<<(argv[x][0]-'1');
printf("new = %s\n",binprint(val,buf));
outb(val,888);
return 0;
}

Last edited by computoman : 10-28-2010 at 08:06 PM.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 12:15 PM.

Rev3 Forum RSS


© 2005-2010 Revision3 Corporation