Devices allow code to be executed on phatIO when data is written to a file by the host computer.
There are several projects in the Ideas section that use drivers.
(driver <filename> <code> ...)
When data is written to the file “
PHATIO/io/dev/<filename>” the remaining arguments are evaluated.
Note, that currently the filename should be 8 alphanumeric characters or less.
See file section on how to read the device files.
The following creates a driver that will turn on the red LED when 1 is written to
PHATIO/io/dev/ and turn it off when 0 is written:
(driver red (led RED (read_hexbyte 0)))