Skip to content

Instantly share code, notes, and snippets.

@kareiva
Created January 20, 2019 12:34
Show Gist options
  • Save kareiva/0c3493178344f1e1ff3586e2bcbc1c1f to your computer and use it in GitHub Desktop.
Save kareiva/0c3493178344f1e1ff3586e2bcbc1c1f to your computer and use it in GitHub Desktop.
#include <sys/ioctl.h>
main() {
int fd;
fd = open("/dev/ttyUSB0",O_RDWR | O_NOCTTY );//Open Serial Port
int RTS_flag;
RTS_flag = TIOCM_RTS;
ioctl(fd,TIOCMBIS,&RTS_flag);//Set RTS pin
getchar();
ioctl(fd,TIOCMBIC,&RTS_flag);//Clear RTS pin
close(fd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment