My first ever robot I got

Posted on 12/11/2011 by microbot777
Modified on: 13/09/2018
Project
Press to mark as completed
Introduction
This is an automatic import from our previous community platform. Some things can look imperfect.

If you are the original author, please access your User Control Panel and update it.

This is a light follower robot that stops in front of objects. Its made from a Microbot from Picaxe. Code:   symbol left = b9 symbol right = b7 symbol difference = b4 main:      if pinC.6 = 1 then      halt A      halt B      wait 2      endif      readadc 7, left      readadc 9, right      pause 10      pulsout C.2, 2      pulsin C.2, 1, w0   ...


My first ever robot I got

Microbot Front

This is a light follower robot that stops in front of objects.

Its made from a Microbot from Picaxe.

Code:

 

symbol left = b9

symbol right = b7

symbol difference = b4

main:

     if pinC.6 = 1 then

     halt A

     halt B

     wait 2

     endif

     readadc 7, left

     readadc 9, right

     pause 10

     pulsout C.2, 2

     pulsin C.2, 1, w0

     w1 = w0 * 5 / 58

     if w1 < 10 then

      halt A

      halt B

      goto main

     endif

     if left > right then

      difference = left - right

      if difference >= 10 then

       halt B

       forward A

      else

       forward A

       forward B

      endif

     else

       difference = right - left

       if difference >= 10 then

        forward B

        halt A

       else

        forward A

        forward B

       endif

      endif

      goto main

 

Follow Light Stop in front of Object

  • Actuators / output devices: motors
  • Control method: auto
  • CPU: Picaxe 20x2
  • Operating system: Windows
  • Power source: 3 AAA
  • Programming language: Basic
  • Sensors / input devices: LDR and SRF005
  • Target environment: indoor
Flag this post

Thanks for helping to keep our community civil!


Notify staff privately
It's Spam
This post is an advertisement, or vandalism. It is not useful or relevant to the current topic.

You flagged this as spam. Undo flag.Flag Post