# robotControl3.bas ' I/O from Palm III to Parallax Basic Stamp II ' uses HotPaw Basic for Palm draw -1 xx = 42 lx= 42 draw 13,58,133,9,5 draw circle 6,62,4 draw circle 152,62,4 draw xx, 60, 5, 5, 4 notup = 1 check1: notup = fn pen(0) while notup <> 0 open "com1:", 19200 as #5 draw "o",13,45 notup = fn pen(4) xx = fn pen(1) yy = fn pen(2) xx = xx - 3 if yy > 55 and yy < 68 then if xx < 13 then xx = lx - 4 notup = 0 endif if xx > 141 then xx = lx + 4 notup = 0 endif if xx > 13 and xx < 141then xout = int((xx - 15)/4) endif serout: put #5, xout s = fn serial(5) if s > 0 then dummy$=get$(#5,s-1) getit2: robotL$ = get$(#5,0) if robotL$ = "-1" then goto getit2 draw robotL$ + " ", 136,45 draw str$(xout) + " ", 116 ,45 draw (lx - 1), 59 , 7, 7,-7 dx = (15 + (xout*4)) lx = dx draw dx, 60, 5, 5, 7 endif wend notup = 1 draw (lx - 1), 59 , 7, 7,-7 draw dx, 60, 5, 5, 4 serout: put #5, xout put #5, xout serin: s = fn serial(5) if s > 0 then dummy$=get$(#5,s-1) getit: if fn pen(4) <> 0 then goto check1 robotL$ = get$(#5,0) if robotL$ = "-1" then goto getit draw robotL$ + " ", 136,45 robx = val(robotL$) if robx <> xout then goto serin close #5 draw " ",13,45 goto check1 end