1 / 40

MICROCAMP V2.0

MICROCAMP V2.0. Introduction to Microcamp MCU Board What is in the Microcamp v2.0 (IROC) Kit Assembling the IROC MAZE ROBOT Simple programming of Microcamp Robot Maze Programming Logic Maze Programming of the Microcamp Robot. Intro to Microcamp.

nedaa
Download Presentation

MICROCAMP V2.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MICROCAMP V2.0 • Introduction to Microcamp MCU Board • What is in the Microcamp v2.0 (IROC) Kit • Assembling the IROC MAZE ROBOT • Simple programming of Microcamp Robot • Maze Programming Logic • Maze Programming of the Microcamp Robot

  2. Intro to Microcamp • Supports ATmega8 Flash memory 8KB. Clock rate 16MHz • 2-DC motor driver, 2 of Buttons, 2 LEDs, 5-Analog port for sensors and Serial communication port. • +5V switching power supply • Require 4 AA size battery. • Support In-system Programming with PX-400 Programmer • Piezo Speaker

  3. What is in Microcamp (IROC)

  4. What is in Microcamp (IROC) Serial LCD Display x 1 GP2D120 x 4 Infrared Reflector x 3 120:1 DC Motor Gearbox x 2 In System Programmer & Cables x 1

  5. Assembling Maze Robot Infrared Reflector Sensor Custom Chassis 2 x AA Battery Holder DC Wheels & Tires Microcamp MCU 48:1 Gearbox

  6. Assembling Maze Robot

  7. Assembling Maze Robot

  8. #include <in_out.h> #include <sleep.h> #include <motor.h> // Motor driver library void main() { while(1) // Endless loop { forward(100); // robot forward. sleep(1000); // Delays 1 second. backward(100); // robot backward. sleep(1000); // Delays 1 second. } } Library Includes Main Procedure Commands Calling Functions Simple Programming Basic Robot Movements

  9. Simple Programming Display Value on LCD #include <soft_serout.h> #include <sound.h> #include <analog.h> unsigned char t_m_txt[4]; void main() // Main Program { sleep(1000); // Delay 1 Sec soft_serout_init(4,9600); // Initial 9600 8N1 on P4 for SLCD while(1) { serout_byte(4,0xFE);serout_byte(4,0x01); serout_byte(4,0xFE);serout_byte(4,0x80); utoa(analog(0),t_m_txt,10); // retrieve P0 data serout_text(4,t_m_txt); // Send Text "MicroCamp to SLCD sleep(500); } } Library Includes Declare Variables Commands Display P0 on SLCD

  10. p4 P0 p3 p2 p1 p4 p3 p2 p1 p0 Maze Logic We will assume that the following sensors are linked to the respective ports on the Microcamp MCU.

  11. Maze Logic • Basic Line Following Procedure • 5 Scenarios • Follow Straight Line (P2 activated) • Cross Junction / T Junction (ALL Activated) • Left Y Junction (P4 activated) • Right Y Junction (P0 activated) • Start and End (Similar to Cross Junction / T Junction)

  12. p2 Maze Logic Follow Straight Line Procedure (P2 activated) void followline() { if (analog(2)<AD3) forward(60); if (analog(1)<AD3) { while (analog(2)>AD3) { s_right(60); } } if (analog(3)<AD3) { while (analog(2)>AD3) { s_left(60); } } }

  13. p1 Maze Logic Follow Straight Line Procedure (P2 activated) void followline() { if (analog(2)<AD3) forward(60); if (analog(1)<AD3) { while (analog(2)>AD3) { s_right(60); } } if (analog(3)<AD3) { while (analog(2)>AD3) { s_left(60); } } }

  14. p3 Maze Logic Follow Straight Line Procedure (P3 activated) void followline() { if (analog(2)<AD3) forward(60); if (analog(1)<AD3) { while (analog(2)>AD3) { s_right(60); } } if (analog(3)<AD3) { while (analog(2)>AD3) { s_left(60); } } }

  15. p4 p0 p3 p2 p1 Maze Logic Cross Junction / T Junction (ALL Activated) void t_junction() { while(1) { followline(); if((analog(1)<AD3)&&(analog(2)<AD3) &&(analog(3)<AD3)) { break; } if(analog(0)<AD3) { break; } if(analog(4)<AD3) { break; } } }

  16. p4 p3 p2 Maze Logic Left Y Junction (P4 Activated) void left_junction() { while(1) { followline(); if((analog(3)<AD3)&&(analog(4)<AD3)) { break; } } }

  17. p0 p2 p1 Maze Logic Right Y Junction (P0 Activated) void right_junction() { while(1) { followline(); if((analog(0)<AD3)&&(analog(1)<AD3)) { break; } } }

  18. p4 p0 p3 p2 p1 Maze Logic Start and End (ALL Activated) void end_junction() { while(1) { followline(); if((analog(1)>AD3)&&(analog(2)>AD3) &&(analog(3)>AD3)) { break; } } }

  19. Maze Programming • - Find the Quickest Path • Plot it out • Program your Robot • Try and Try

  20. Maze Programming Start Point

  21. Maze Programming Start PointFollowLine

  22. Maze Programming Start PointFollowLineCross-Junction, Go Straight

  23. Maze Programming Start PointFollowLineCross-Junction, Go straightFollowLine

  24. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn Left

  25. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLine

  26. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn Right

  27. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLine

  28. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn Left

  29. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLine

  30. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go Straight

  31. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLine

  32. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go Straight

  33. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go StraightFollowLine

  34. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go StraightFollowLineCross-Junction, Go Straight

  35. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go StraightFollowLineCross-Junction, Go StraightFollowLine

  36. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go StraightFollowLineCross-Junction, Go StraightFollowLineY-Junction, Turn Right

  37. Maze Programming Start PointFollowLineCross-JunctionFollowLineT-Junction, Turn LeftFollowLineY-Junction, Turn RightFollowLineY-Junction, Turn LeftFollowLineCross-Junction, Go StraightFollowLineY-Junction, Go StraightFollowLineCross-Junction, Go StraightFollowLineY-Junction, Turn RightFollowLine

More Related