Go to Post "Programming is 1% talent and 99% not getting distracted by the Internet." - FRC4ME [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-06-2009, 21:01
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
IO

I am trying to build an ROV with an old mainboard running puppy linux as a OS. I want to use the Parallel port and game port for I/O I am currently programing in Java and I am having trouble finding a good way to read specific lines and pulsing specific lines. Does anyone know a good way or do I need to program in C/C++?
  #2   Spotlight this post!  
Unread 11-06-2009, 03:09
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,392
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: IO

Try this setup of paraport libraries. Pretty simple, runs on Liunx and Windows.
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
  #3   Spotlight this post!  
Unread 11-06-2009, 09:20
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: IO

That looks like it will work. I saw it earlier, but didn't look much. Thanks. Now I just need a way to work with the joystick. I can find pleanty of drivers that will let me read from the port, but I haven't come across anything that will let me send signals yet.
  #4   Spotlight this post!  
Unread 11-06-2009, 11:00
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,392
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: IO

Write to the 15 pin game port for the joystick? Even in the days of MS-DOS bit banging that was a pain. I'll Google around for MIDI interfaces to see whats out there. You may end up with a C/C++ wrapper for the MIDI port tweeks then making JNI calls for the joystick.

Can you use a serial stream that would come from a MIDI, or are you really looking for the bits to do IO that way?
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
  #5   Spotlight this post!  
Unread 11-06-2009, 17:24
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: IO

I know with ASM it is not difficult. However, learning ASM is a real pain. There are no nice peak/poke functions anymore. I was hoping I could use the port as a kind of analog send or at least a 5V source for some sensors. However, if it is not possible I can use outboard power. I just thought it would help.
  #6   Spotlight this post!  
Unread 12-06-2009, 15:13
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: IO

I did manage to find a joystick library for C a little while ago called libjsw. If you can't find anything else, you could use a C wrapper for this library. Basically, it uses structures for each joystick, pretty much just like the objects in java, so if you can find someone who's good enough with C to break it down, you could rewrite it in java without TOO much complication.

And I like your premise. I've got 5 old (and I mean OLD) laptops sitting around that I've been thinking about repurposing in just this way. If Puppy Linux proves to be too slow (can't imagine it would be that bad), and you need something more time-critical, might I suggest MINIX? It's one of the ORIGINAL Unix operating branches, and has been designed to be tiny. Just food for thought.

If you're not adverse to learning C, this project would probably be quite a bit easier for you. The libjsw library is written in C natively, and there are two functions in <asm/io.h> called inb() and outb() which can access any port on the computer using the hex address. The parallel port is generally 0x378 and 0x379 for write and read, respectively, I believe. There's a good tutorial for C control of the parallel port here. I have managed to run a small motor from a transistor amplifier directly from the parallel port using this method.

Good luck, sounds like fun! And let us know what you learn along the way, I'm going to see if I can convince our team to let me run our summer swerve drive project on Linux.
  #7   Spotlight this post!  
Unread 13-06-2009, 22:35
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: IO

I am not adverse to learning C. I know a little bit, and know several languages based on C, so syntax is basically what I need to learn. I didn't want to use C, though, because I am a better Java programer. Also, I wanted the end program to be as platform independent as possible. The more I think about it, I think I will just use external power.

I used a flash drive to store and run the OS. That way, it can be banged around and moved without having to worry about moving disks. I think Puppy should be fine. It doesn't have a high overhead and I know it will run Java.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 -5. The time now is 01:13.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi