Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tesonep/serialport
https://github.com/tesonep/serialport
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tesonep/serialport
- Owner: tesonep
- License: mit
- Created: 2021-07-26T18:49:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-20T18:24:02.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T07:21:22.169Z (about 2 months ago)
- Language: Smalltalk
- Size: 35.2 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pharo SerialPort
I am a FFI implementation of the SerialPort interface for Pharo.
To install, just use:
```Smalltalk
Metacello new
baseline: 'SerialPort';
repository: 'github://tesonep/SerialPort:main';
load.
```I am implemented using purely the FFI support in the image.
I am tested to run in Linux, OSX and Windows.For an easy example of use check: ```SerialPortTest >> #testOpenArduino```.
Here there is a code snippet.
```Smalltalk
| stringToSend receivedString |
sp := SerialPort new.
sp baudRate: 38400.
sp openPort: self portName.stringToSend := DateAndTime now printString.
sp writeByteArray: stringToSend utf8Encoded.
receivedString := (sp readByteArray: 10000) utf8Decoded.
self assert: receivedString equals: stringToSend size printString ]
```