SRS Labs SRS Robot Level 1 Kit manual Program Turn

Page 30

Sample Programs

Program 8

Purpose: Learn to use the Timer/Counter for timing. This program flashes a LED at a specific rate while reading sensors.

Program: Timer

Extensions:

oChange the flash rate.

oAdd more code to the loop, e.g. showing sensor values. Notice that the flashing still maintains its rate, with no

changes necessary. Challenges:

oModify your EEPROM program to use the timer instead of WaitMs when showing sensor readings. o Read sensors for 10 milliseconds and calculate the average value.

Program 9

Purpose: Learn how to use proportional steering to follow a line.

Program: LineFollow

Extension: Tune values for your robot. Adjust the light thresholds (use ADCPrint to see sensor values). Adjust the scaling proportion for steering.

Challenge: Go faster without falling off the line.

Program 10

Purpose: This program shows how to implement the states involved in detecting and identifying a junction. It will determine which options are available (left, right, forward), then stop.

Program: Junction

Extension: Tune values for your robot. Challenges:

oDetect end of maze (solid 6” diameter black circle).

oUse sensor sample averaging -- take several readings and use their average when making decisions. o Save light sensor thresholds in EEPROM.

Program 11

Purpose: This program shows how to implement the states involved in turning at a junction.

Program: Turn

Extension: Tune values for your robot.

Challenge: Go faster!

Program 12

Purpose: This program shows how to use a table to store a sequence of control commands for the robot. It also demonstrates how to store constant data (the table) in program memory (Flash) instead of the default SRAM.

Program: DeadReckon

Extension: Modify/Add commands to the table.

Challenge: Add another piece of data to the state, e.g. LED on/off.

30

11-3-2005

Image 30
Contents SRS Robot Level 1 Kit Recommended Equipment Getting StartedComputer Requirements USB port with a USB-to-serial converterKit Contents ARC Board Connection Kit Vendor InformationQty Vendor Part AVR Robot Controller 1.1 Assembly Instructions PreparationSoldering Overview Solder Components Prepare BoardsController ‰ Resistors and diode‰ Switch and resonator ‰ Small capacitors and LEDs‰ Sockets, headers, and jumper Cleaning and InspectionAttach Connector to Battery Holder ‰ Large capacitorsInstall Chips Serial CableAVR Robot Controller 1.1 Software Tools Programming CableTool Options Bascom on WindowsWinAVR avr-gcc on Windows Customizing the Microcontroller Avr-gcc on Mac OSResources Http//sourceforge.net/projects/winavrChassis Assembly MotorsLight Sensors Bottom PlateTop Plate Final Assembly Wiring Connections Leftover PartsATmega16 Programming PartATmega16 Programming 11-3-2005 Part ATmega16 Programming 11-3-2005 Part ATmega16 Programming 11-3-2005 ATmega16 Programming 11-3-2005 Part Sample Programs Creating New ProgramsProgramming Program DescriptionsProgram BumpNGo RemoteControlProgram Turn AVR Robot Controller 1.1 Hardware Description PowerPins Physical Functional Input Connection Pin Name Output HeaderLeft and Right Analog Inputs Left and Right Motor ConnectorsExpansion Headers JP3 and JP10 Left, Center, and Right Floor Sensor InputsProgram LED output Power SourceIn-System Programming and Option Select Servo outputAVR Robot Controller 1.1 Schematic