Can you give your code on here so we can see what you did?
Posts by tiger5248
-
-
I am trying to figure out how to program a simple karel program that while the robot is running it is posting the position data vs time to a csv file. I have wrote out something that seems to work a little as far as creating the csv file and then posting the correct data, once. But in a loop it haults the TPP programs and doesn't let it continue to run. Please see below and please give any Karel Help you can. I also wonder if any of you know of resources, other than this, online for Karel programming. I know coding pretty well and most the time what you don't know you can research, except for this language it seems to be just a mystery.
Thank you for whatever help you can give!
PROGRAM UD1_WRITE
%NOLOCKGROUPVAR
FTP_FILE :FILE
--------------------------------------
ROUTINE init_cond
BEGIN
IF OPOUT[1] = ON
THEN
ENDIF
END init_cond
--------------------------------------
ROUTINE write_file
BEGIN
WRITE FTP_FILE ($SCR_GRP[1].$MCH_POS_X,',')
WRITE FTP_FILE ($SCR_GRP[1].$MCH_POS_Y,',')
WRITE FTP_FILE ($SCR_GRP[1].$MCH_POS_Z,',')
WRITE FTP_FILE ($TIMER[1].$TIMER_VAL,CR)
DELAY 100
END write_file
--------------------------------------
BEGIN
OPEN FILE FTP_FILE ('AP', 'UD1:\TEST13.CSV')
WRITE FTP_FILE('X-POS, Y-POS, Z-POS, TIME',CR)
WHILE TRUE DO
init_cond
write_file
ENDWHILE
WRITE FTP_FILE ('test complete',CR)
CLOSE FILE FTP_FILE
END UD1_WRITE