' US-100 Sensor auslesen 17. Oktober 2023 kh Option escape SetPin gp1, gp0, com1 Open "com1:9600" As #5 Print #5, "\&50"; CPU sleep 1 num_bytes = Loc(#5) dat$ = Input$(20, #5) temp = Str2bin(int8, dat$) - 45 Print "bytes received: "; num_bytes Print "Temperatur: "; temp Print #5, "\&55"; CPU sleep 1 num_bytes = Loc(#5) dat$ = Input$(20, #5) dist = Str2bin(uint16, dat$, BIG) - 45 Print "bytes received: "; num_bytes Print "Abstand: "; dist Close #5