About Buy News Guide Ideas
The phatIO project has finished, and I'm no longer selling ready made boards - but you're welcome to look around - send any questions to the email below

Back to Table of Contents

#Devices and Drivers

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> ...)[driver]

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)))
@Contact  |   Legal & Privacy  |    RSS  |   Development Twitter  |   Official Twitter
© phatIO 2012, All Rights Reserved.