Advanced Program #1
In this program we will teach our robot to react to a touch sensor being pressed and released. We will be using the Complete Palette instead of the Common Palette. Click on the images below to enlarge them!
(Step 1) Drag out a Wait Block from the flow bar, set the mode to time, and the duration to 5 seconds. This causes our robot to pause for five seconds before executing its desired function.
(Step 2) Drag out a Loop Block, this lets us execute the function over and over again until we want to end the program.
(Step 3) From the sensor bar, drag out a Touch Sensor Block and place it inside the loop. At the moment this block has no function!
(Step 4) From the action bar, drag out a Color Lamp Block and place it inside the loop. This has no function at the moment either! Now click on the circled area which is shown in the picture to activate the data hub! The picture shows what it looks like after you click on the Data Hub Tab.
(Step 5) Finally! Now we get to the most important part of this program the Data Wires! Hover your mouse over the Logic hub until the oil can appears, then click and attach the green wire to the action hub on the Color Lamp. Look at the picture!
(Step 6) Good Luck!
(Step 2) Drag out a Loop Block, this lets us execute the function over and over again until we want to end the program.
(Step 3) From the sensor bar, drag out a Touch Sensor Block and place it inside the loop. At the moment this block has no function!
(Step 4) From the action bar, drag out a Color Lamp Block and place it inside the loop. This has no function at the moment either! Now click on the circled area which is shown in the picture to activate the data hub! The picture shows what it looks like after you click on the Data Hub Tab.
(Step 5) Finally! Now we get to the most important part of this program the Data Wires! Hover your mouse over the Logic hub until the oil can appears, then click and attach the green wire to the action hub on the Color Lamp. Look at the picture!
(Step 6) Good Luck!