Skip to content

Instantly share code, notes, and snippets.

@matael
Forked from Aluriak/Lessive.c
Created December 23, 2011 14:59
Show Gist options
  • Save matael/1514414 to your computer and use it in GitHub Desktop.
Save matael/1514414 to your computer and use it in GitHub Desktop.
NXC : Lessive
// utilisation des capteurs
#define Port_Tactile IN_1
#define Port_Telemetre IN_2
#define Port_Microphone IN_3
void setup()
{
SetSensorTouch(Port_Tactile);
SetSensorSound(Port_Microphone);
SetSensorLowspeed(Port_Telemetre);
}
task main()
{
setup();
until(Sensor(Port_Microphone) > 60);
OnFwd(OUT_BC, 100);
until(Sensor(Port_Telemetre) < 20)
OnFwd(OUT_BC, 25);
until(Sensor(Port_Tactile) == true);
Off(OUT_BC);
Wait(1000);
RotateMotor(OUT_BC, 25, -360);
RotateMotorEx(OUT_BC, 25, 540, -100, true, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment