Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Drills
1. Robot C Drills Title: COMMENTS After reading the code example below, comment the code as to give a reader a description of what task the code will perform. task main() { motor[port3]=127; motor[port2]=127; wait1Msec(5000); //motor[port3]=127; //motor[port2]=-127; //wait1Msec(1500); }
2. Robot C Drills Title:WHITESPACE After reading the explanation of whitespace in the handout, re-write the following code using whitespace to make it more readable. task main() {motor[port3]=127; motor[port2]=127; wait1Msec(5000); //motor[port3]=127; //motor[port2]=-127; //wait1Msec(1500);}
3. Robot C Drills Title:PSEUDO-CODE After reading the explanation of pseudo-code in the handout, write a pseudo-code example for the tasks to be accomplished in Assignment #1.
4. Robot C Drills Title:FLOWCHARTS After reading the explanation of flowcharts in the handout, create a flowchart for the tasks to be accomplished in Assignment #1.
5. Robot C Drills Title:FLOWCHARTS After reading the explanation of flowcharts in the handout, create a flowchart for the tasks to be accomplished in Assignment # 3.
6. Robot C Drills Title:FLOWCHARTS Using yesterday’s flowchart as a guide, create a flowchart for what is actually happening with the hardware in assignment #3. Why do we need to add an extra check for the optical switch being tripped?
7. Robot C Drills Title:Debouncing Using the Teaching Robot C software on your computer and the QuickTap software routine, define the term “debouncing”. How would this help your code in assignment #4.
8.
9.
10.
11. Program Template Computer Generated Instructions //*!! Code automatically generated ….. //*!! Start automatically generated configuration …. Assignment or task /* Include any written assignment or task definition, giving all details. */ Hardware configuration /* How the hardware is hooked up. */ task main () { Variable declaration; //declares the variables to be used Variable definition; //assigns values to the variables to be used Actions or tasks; //explain each step of the action or tas }