Groups
Groups
Sign in
Groups
Groups
Racket Users
Conversations
About
Send feedback
Help
Writing to serial port?
30 views
Skip to first unread message
Zeta Convex
unread,
Sep 23, 2021, 1:31:53 PM
9/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Racket Users
How do I write to a serial port? I'm on Linux, and want a baud rate of 115200.
I'm new to Scheme. I can't seem to find a library to do what I want.
Zeta Convex
unread,
Sep 23, 2021, 1:55:53 PM
9/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Racket Users
Ah, OK. It seems fairly straightforward:
(system "stty -F /dev/ttyACM0 115200 crtscts")
(define out 0)
(set! out (open-output-file "/dev/ttyACM0" #:mode 'binary #:exists 'append))
;(set! in (open-input-file port-name #:mode 'binary))
(file-stream-buffer-mode out 'none)
(write-byte whatever out)
(close-output-port out)
Reply all
Reply to author
Forward
0 new messages