python - Running a file on my computer from an arduino -
i have idea building own auto-rotating monitor, in orientation of monitor changes when rotates. creating arduino (or raspberry pi or something) easy, getting input accelerometer , doing when rotates 90 degrees, , creating python file on computer change orientation of monitor easy well. can't figure out how arduino call file on computer when receives signal. possible, , if so, how do it?
arduino won't call file on computer directly. communicates through serial port, , can send/receive bytes have parse , determine action.
you have make basic protocol send accelerometer data computer (raw data enough) through serial port. there, serial communication open, translate actions , call respective script want.
making arduino call file require making library in arduino, , interpreter in host computer.
as comment, not close serial communication arduino until finish using it, since arduino resets every time establishes new serial connection, generating unwanted delays.
Comments
Post a Comment