FlexProp FlexBASIC need help
Not sure where the problem is. The below sub is on my Activity Board which is connected to the Create 2 robot. When I run this program I keep getting different results on each run.
Normally it should put out a consistent 16, but on one run it will be 65, then 35, and then 16. Not sure if it is something with the sub code, or is the problem somewhere else.
dim highbyte as uinteger
dim lowbyte as uinteger
dim tempbyte as uinteger
cr2.tx(142) cr2.tx(22) highbyte = cr2.rx() pausems 20 lowbyte = cr2.rx() pausems 20 tempbyte = ((highbyte << 8) + lowbyte) tempbyte = (tempbyte / 1000) print #2, tempbyte