View unanswered posts | View active topics It is currently Sat Oct 25, 2014 11:56 pm






Reply to topic  [ 1 post ] 
Problem with sensor sonar 
Author Message
Rookie

Joined: Thu Feb 09, 2012 1:11 pm
Posts: 4
Post Problem with sensor sonar
Hello,

I am french, I have some problem with sensor sonar. When a start program, the value of sensor program is good but after a moment, the sensor sensor falls into default. I see it in the window "NXT Device Control" the sensor value indicates "rangeErr" and after "modeRaw", the value switches from one mode to another.
The program runs en RobotC 3.08 (F/W9.12).

#pragma config(Sensor, S1, touchSensor, sensorTouch)
#pragma config(Sensor, S2, soundSensor, sensorSoundDB)
#pragma config(Sensor, S4, sonarSensor, sensorSONAR)
#pragma config(Motor, motorB, motorB, tmotorNormal, PIDControl, encoder)
#pragma config(Motor, motorC, motorC, tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#define vit 50

task main()
{
// synchro moteur a faire une fois
nMotorEncoder[motorC] = 0;
nMotorEncoder[motorA] = 0;

nSyncedMotors = synchBC; // synchro sur le moteur B qui est maitre

nSyncedTurnRatio = 100;

while(true)
{
motor[motorB] = vit;
if(SensorRaw(sonarSensor) < 20)
{
motor[motorB] = 0;
wait1Msec(500);
motor[motorB] = -vit;
wait1Msec(3000);
gauche();
}
}
}

Thank for your help.


Last edited by ubik75 on Fri Apr 06, 2012 2:09 am, edited 1 time in total.



Thu Apr 05, 2012 12:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: Ben 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.