hello,
i have some problems to convert spin-code into c-code for the simpleIDE.
-1) spin-code:
c-code:
- 2)
spincode:
c-code: From the elev lrf sf02
are the c-code correct or wrong ?
thanks for tips and hints
regards
nomad
i have some problems to convert spin-code into c-code for the simpleIDE.
-1) spin-code:
pst.Str(String("Waiting for LRF module..."))
waitcnt(clkfreq << 1 + cnt) ' Delay for 2 seconds to let the LRF module start-up
serial.Tx("U") ' Send character
repeat until serial.RxCheck == ":" ' When the LRF has initialized and is ready to go, it will send a single ':' ve it
pst.Str(String("Ready!", pst#NL, pst#NL)) ' Ready to go!
c-code:
serial* serLrf = serial_open(0, 1, 0, 115200);
print("Waiting for LRF-module...\n");
pause(2000);
writeChar(serLrf, 'U');
while(serial_rxChar(serLrf) == ':');
print("READY\n");
- 2)
spincode:
serial.Tx("R")
repeat until serial.RxCheck == "D"
repeat until serial.RxCheck == "="
repeat until serial.RxCheck == " "
range := serial.RxDec
c-code: From the elev lrf sf02
memset(s, 0, 6);
for (i = 0; i < 6; i++)
{
s = readChar(sf02);
if(s == '\r') break;
}
sscan(s, "%f", &dist);
are the c-code correct or wrong ?
thanks for tips and hints
regards
nomad