Usleep( 10 * 1000 ) // wait 10 msec try again Int n = read(fd, b, 1) // read a char at a time Int serialport_read_until(int fd, char* buf, char until) Int serialport_write(int fd, const char* str) Int serialport_writebyte( int fd, uint8_t b) Printf("wrote %d bytes, read %d bytes: %s\n", rc, n, buf) printf("Waiting until UART buffer clears: %d\n", tcdrain(fd)) " means 'wait 2secs, send 'hello', wait 100msec, get reply'\n"įd = serialport_init("/dev/ttyACM0", baudrate) " Used to make series of actions: '-d 2000 -s hello -d 100 -r' \n" " -d -delay=millis Delay for specified milliseconds\n" " -n -num=num Send a number as a single byte\n" " -r, -receive Receive data from Arduino
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |