task main() { //Program begins, insert code within curly braces turnLEDOff(green); //initializes green LED light in the program, starting in the off position wait(1); //runs previous code for 1 second before moving on turnLEDOn(green); //Turns on the green LED wait(1); //runs previous code for 1 second before moving on turnLEDOff(green); //Turns off the Green LED wait(1); //runs previous code for 1 second before moving on turnLEDOn(green); //Turns on the green LED wait(1); //runs previous code for 1 second before moving on turnLEDOff(green); //Turns off the Green LED }
task piston(){ while(true){ turnLEDOn(dgtl1); wait1Msec(iPistonTime); turnLEDOff(dgtl1); wait1Msec(iPistonTime); } }
task flapWing(){ while(true){ while(SensorValue[Swings] < iWingTop){ motor[wings] = 60; } turnLEDOn(dgtl1); while(SensorValue[Swings] > iWingDown){ motor[wings] = -15; } turnLEDOff(dgtl1); motor[wings] = 0; } /*while(true){ while( SensorValue[Swings] < iWingTop){ motor[wings] = iWingPower; } while( SensorValue[Swings] > iWingDown){ motor[wings] = -iWingPower; } }*/ }