Setting sensor port pin properties

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

Setting sensor port pin properties

Postby matsik » Wed Apr 30, 2008 4:15 pm

I have read (in several documents) about the possibility to set pins to act in a non-default way. Specifically pin 1 to act as a +9V provider and pin 6 as a high speed analog input.

Question: how, if at all possible, is this done in LeJOS?
matsik
New User
 
Posts: 1
Joined: Wed Apr 30, 2008 4:04 pm

Postby gloomyandy » Wed Apr 30, 2008 8:38 pm

Hi,
Pin 1 can be set to output 9V by leJOS. Take a look at...
http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/classes/lejos/nxt/SensorPort.java?view=markup
Take a look at the native methods setADTypeById and setPowerTypeById the comments should explain what is going on.

There is currently no support in leJOS for using Pin 6 as an analog input.

What sort of device are you looking to connect? The standard analog input is effectively sampled every 2ms, do you need a higher sample rate then this?

All the best

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3965
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby kirkpthompson » Thu May 01, 2008 10:00 pm

Hi Andy. My Gyro inertial integrator may need faster sample rate... :P

-K :wink:
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA


Return to NXJ Hardware

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

more stuff