Here’s an early demo of the other robot I’ve been working on. This is the beginning of a LOGO “turtle” robot… a robot that follows instruction that tell it how to draw a picture. It drives around on a sheet of paper leaving an ink trail with its pen. I’ve written and debugged almost all of the verilog code, I just have to build its body and wire up some electronics. In the video, it’s executing this program:
SET r0, 1 ; initial box size
SET r1, r7 ; number of rings
drawbox:
PD
FW r0
R 90
FW r0
R 90
FW r0
R 90
FW r0
PU
FW 1 ; Move to SW corner
L 90
FW 1
R 180 ; Face North
INC r0
INC r0 ; boxsize += 2
DEC r1
JNZ r1, drawbox
END
SET r1, r7 ; number of rings
drawbox:
PD
FW r0
R 90
FW r0
R 90
FW r0
R 90
FW r0
PU
FW 1 ; Move to SW corner
L 90
FW 1
R 180 ; Face North
INC r0
INC r0 ; boxsize += 2
DEC r1
JNZ r1, drawbox
END
The above program assembles the following machine code:
6001 //SET r0, 1
6307 //SET r1, r7
5000 //PD
0800 //FW r0
2009 //R 90
0800 //FW r0
2009 //R 90
0800 //FW r0
2009 //R 90
0800 //FW r0
4000 //PU
0001 //FW 1
3009 //L 90
0001 //FW 1
2012 //R 180
7000 //INC r0
7000 //INC r0
8001 //DEC r1
B202 //JNZ r1, addr[2]
C000 //END