View unanswered posts | View active topics It is currently Sat Sep 05, 2015 12:44 pm






Reply to topic  [ 3 posts ] 
Light Sensor setup issue 
Author Message
Rookie

Joined: Wed Jul 01, 2015 5:30 am
Posts: 3
Post Light Sensor setup issue
Hey Guys Im new here to this forum.

I have been using vex for a few months now but having an issue with setting up a light sensor. Ground, Signal and 5V are connected correctly and the port I'm using is analog 3. The LED in the light sensor never turns on unless put into a digital (output), when using on an analog input the stray figures is always around 240-250 with no change. The LED also doesn't turn on either. Any help is greatly appreciated!


Wed Jul 01, 2015 5:38 am
Profile
Rookie

Joined: Wed Jul 01, 2015 5:30 am
Posts: 3
Post Re: Light Sensor setup issue
Solved, 5v (red wire) was internally broken weirdly, working great now!


Wed Jul 01, 2015 7:55 am
Profile
Rookie

Joined: Wed Jul 01, 2015 5:30 am
Posts: 3
Post Re: Light Sensor setup issue
In setting up I have come across another issue, Getting the robot to respond to the range of the colour green is not working at all. For example; **This isnt the whole program but the snippets which should be working for this particular section

#pragma config(Sensor, in1, LeftLight, sensorReflection)
#pragma config(Motor, port1, Left, tmotorVex393, openLoop)
#pragma config(Motor, port10, Right, tmotorVex393, openLoop)

if (SensorValue[LeftLight]<290&&SensorValue[LeftLight]>430)turnLeft();

void turnLeft()

{

motor[Left]=0;
motor[Right]=0;
wait1Msec(1500);
motor[Left]=-60;
motor[Right]=60;
wait1Msec(1500);


}

When line following, the robot simply bypasses the green square segment and doesnt even attempt to stop. I have checked the values of the green and they are well between 290 and 430. I have also tried with this with no result as well.

if (SensorValue[LeftLight]<290)
{
if (SensorValue[LeftLight]>430)
{
turnLeft();
}
}

All that is trying to be achieved is for the Robot to stop when it sees a green square with values ranging between 350-400 then make a left turn (in these examples). I'm stuck here and any help is much appreciated!

-Scott.


Thu Jul 02, 2015 9:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users 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.