View unanswered posts | View active topics It is currently Thu Sep 18, 2014 10:19 am






Reply to topic  [ 3 posts ] 
Old light sensors and NXT 
Author Message
Rookie

Joined: Tue Mar 11, 2008 7:33 am
Posts: 11
Post Old light sensors and NXT
I'm trying to use the old light sensors in RobotC with the NXT. It can be done with NXT-G and using the Legacy Blocks, but I haven't had much success on RobotC.
If possible, it would be great to have the raw value from the sensor with the light active.

Cheers, Kit.


Wed Jul 16, 2008 3:49 am
Profile
Rookie

Joined: Tue Mar 11, 2008 7:33 am
Posts: 11
Post 
It's ok. I just needed to use the "sensorReflection" type.


Wed Jul 16, 2008 5:49 am
Profile
Rookie

Joined: Sun Aug 12, 2007 3:18 pm
Posts: 38
Post 
With the next code you will have the raw value (with RobotC 1.38BETA version)

Code:
//*!!Start automatically generated configuration code.                           !!*//
const tSensors S1                   = (tSensors) S1;   //sensorReflection   //*!!!!*//
//*!!CLICK to edit 'wizard' created sensor & motor configuration.                !!*//

task main ()
{
   while (true)
   {
      nxtDisplayString(3, "%d",SensorRaw[S1]);
   }
}

_________________
Image http://lrobotikas.net English version


Wed Jul 16, 2008 2:13 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: skatefriday and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.