Romeo the Robot

Here is a video of the current prototype being controlled with the WirelessPLATFORM, and JoyStickPLATFORM.

Romeo School Challenges – http://www.teaching-innovation.com/learn/romeo-challenge/

Sample Code:

' Pinout for ProtoPlatform using PICAXE 20M2 Microcontroller.
' "P#" can be replaced with a descriptive word for the input/output pin.
' For example P18 Could be replaced with "YLED" to represent the connected Yellow LED
 
'SYMBOL P1	  = +V		SYMBOL P20 = 0V
'SYMBOL P2	  = SerIn		SYMBOL P19 = SerOut
 SYMBOL P3	  = C.7		SYMBOL YLED = B.0
 SYMBOL P4	  = C.6		SYMBOL P17 = B.1
 SYMBOL MotB1 = C.5		SYMBOL P16 = B.2
 SYMBOL MotA2 = C.4		SYMBOL P15 = B.3
 SYMBOL MotA1 = C.3		SYMBOL MotB2 = B.4
 SYMBOL S1A = C.2			SYMBOL S2A = B.5
 SYMBOL S1B = C.1			SYMBOL S2B = B.6
 SYMBOL S3A = C.0			SYMBOL S3B = B.7
 
Init:		' this part of the code is an initialise "init" program that gives you time to put your robot down after
		' programing or turning the robot on.
 
	high YLED			'Yellow LED turns on
	pause 4000			'Program pause for 4 seconds
	low YLED			'Yellow LED turns off
	pause 1000			'Program pause for 1 second
 
Main:			'The "Main:" label is a place in the code that can be called using "goto main" command
 
	gosub fwd	' the word "Forward" is already a command used by this software so fwd is annother suitable term to describe this sub routeine
	gosub back	' each of these are sub routines and after they are completed the "return" command continue the program from where it was up to
	gosub right
	gosub left
 
	pause 5000	'any pause command can be a number between 0 and 65535 (0 and 65.53 seconds)
 
	goto main
 
fwd:
	high MotA1, MotB1		' To go forward both motors A & B need to be turn high in direction 1
	low MotA2, MotB2		' similar to hooking a motor up to a battery it is important to ensure both terminal are 
					' connected and therefore we give a low command to the direction 2 terminal.
 
  	pause 5000			' program continues in its current state for 5 seconds
 
	low MotA1, MotB1, MotA2, MotB2	' this low commands ensure all motors have been turned off. Notice more than one motor can be turned off using commas to seperate	
  	pause 1000
 
	return			' The return command asks the code to contune where it was upto prior to the gosub.
 
back:
	high MotA2, MotB2		'to go backward both motors A & B need to be turned high in direction 2
	low MotA1, MotB1		'as suggested above it is important to remember to ensure direction 1 is in a low state
					'you may have notice that these motor imput were already low, however, it is good practice to use this extra line to ensure they have been turned to low.
	pause 5000
 
	low MotA1, MotB1, MotA2, MotB2
  	pause 1000
 
	return
 
right:
	high MotA1			'to turn right Motor A (feft hand motor) direction 1 (forward) needs to be turned high	
   	low MotA2			' and Motor A direction 2 needs to be low.
 
 	pause 5000
 
	low MotA1, MotB1, MotA2, MotB2
  	pause 1000
 
	return
 
left:
	high MotB1
  	low MotB2
 
	pause 5000
 
	low MotA1, MotB1, MotA2, MotB2
  	pause 1000
 
	return
 
goto Main

Coming soon… Email sales@teaching-innovation.com to pre-order.

Order Romeo The Robot