|
|
|
|
|
The test program can be designed in the Flowchart editor with only two icons. The sensor must be read and that is performed with the readadc command. Note that you cannot define the name of the sensor input from the Flowchart symbol table. However, you can enter the destination of the data by choosing the variable called lightvalue that you have entered. You can change the value when you go to the Convert Flowchart to BASIC option. Run the simulation and you can change the value of Lightvalue by sliding the Analogue bar around.
|
|
When you download the program to the real Control 7 you can see the sensor value in the debug window as you move the sensor. We used a light sensor. Note that you can change the readadc 1, lightvalue to readadc sensor1, lightvalue to preserve the ease of reading the sensor values. Take a note of the readings to get an idea of the typical values for dark and light conditions.
|
|
This examples pushes you a little harder by setting up a problem. You want the light value to be recorded and then turn on the motors and lights. The directions have to control 2 motors and 2 lights. This example shows you the easiest way to control these number of devices with the pins command. Place the icons and link them as in the figure below. The IF lightvalue > 68 sets up a comparison point . The let pins = 0 commands are stubs or empty lines because it is difficult to work out the binary values that correspond to the light1, light2, motor1, motor2 values. You will fill in the values when you convert the flowchart to BASIC.
|
|
|
|
Step 1 Here is the result of the conversion to BASIC from the flowchart. |
![]() |
|||
|
Step 2 Here you fill in the values of the pins command to reflect the actual value required. Check the values against the circuit schematics or the Flowchart Symbol Table. Download this program and you should see the lights and motors come on and change directions as you change the sensor value.
|
|||
![]() |
| [Home] [About] [News] [Events] [Products] [CAD] [CAM] [Control] [Mechatronics] [Science] [Materials] [Support] [Map] [Contact] |
|
PICMicro & Microchip logo are registered trademarks of Microchip Technology Inc. AZ. Atmel AVR & Atmel logo are registered trademarks of Atmel Corporation. CA. Philips Logo is a registered trademark of Philips Semiconductor Inc & Philips SA, Netherlands. Picaxe is a registered Trade mark of Microchip. Intellecta is a registered trademark of Intellecta Technologies. All other logos and trademarks are the property of their respective owners. Revision Date June2006 © 1997- 2006 Intellecta Technologies - All rights reserved - email: supportatintellectadotnet |