Autonomous is anything that you make it do in steps. For example, if you look at Color Sensor - Line Following sample programs or if you copy-paste several of those together, you have a sequence of steps. Take a look at Basic Line tracking, it is using sensors to drive itself along a line. Line Track for Time follows a line only for predetermined time. Just try putting together a bunch of code from samples provided (basic movements, sensors, etc) and watch it run.
After that you can make your own challenge… Draw a large square. Make a program to drive the robot on that square… Move on.
Also all the programs from Basic Movements sample code are considered autonomous (no controller involved) … Moving Forward, as soon as it is run, I recall moves forward for 2 sec and stops. Point Turns sample makes two movements.
Autonomous program starts executing as soon as you “run” the program. Using sensors, you can make your sequence start/stop when you want rather than executing those steps as soon as you select the program from the brain slot. Many people use a touch sensor for that.
Moving Forward:
task main()
{
setMotorSpeed(leftMotor, 50); //Set the leftMotor (motor1) to half power (50)
setMotorSpeed(rightMotor, 50); //Set the rightMotor (motor6) to half power (50)
sleep(2000); //Wait for 2 seconds before continuing on in the program.
}
Point Turns:
task main()
{
setMotorSpeed(leftMotor, -127); //Set the leftMotor (motor1) to full power reverse (-127)
setMotorSpeed(rightMotor, 127); //Set the rightMotor (motor6) to full power forward (127)
sleep(1000); //Wait for 1 second before continuing on in the program.
setMotorSpeed(leftMotor, 127); //Set the leftMotor (motor1) to full power forward (127)
setMotorSpeed(rightMotor, -127); //Set the rightMotor (motor6) to full power reverse (-127)
sleep(1000); //Wait for 1 second before continuing on in the program.
}
Combining the two basic programs: So this goes forward for 2 sec, then turns left, then turns right. End of program…
task main()
{
setMotorSpeed(leftMotor, 50); //Set the leftMotor (motor1) to half power (50)
setMotorSpeed(rightMotor, 50); //Set the rightMotor (motor6) to half power (50)
sleep(2000); //Wait for 2 seconds before continuing on in the program.
setMotorSpeed(leftMotor, -127); //Set the leftMotor (motor1) to full power reverse (-127)
setMotorSpeed(rightMotor, 127); //Set the rightMotor (motor6) to full power forward (127)
sleep(1000); //Wait for 1 second before continuing on in the program.
setMotorSpeed(leftMotor, 127); //Set the leftMotor (motor1) to full power forward (127)
setMotorSpeed(rightMotor, -127); //Set the rightMotor (motor6) to full power reverse (-127)
sleep(1000);
}
You may want to start with graphical, easier.