top
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

Ability to read and write to arbitrary files is being developed for the first release.

The following are stop-gap temporary functions for use in device drivers.

##(read_byte <position>) [read_byte] Reads and returns the byte at the specified position in the device file. For example, the following would write “97 90” when “aZ” is written to the start of file PHATIO/io/dev/test (the binary values of ASCII characters ‘a’ and ‘Z’

(driver test
	(keyboard (read_byte 0) " " (read_byte 1)))

##(read_hexbyte <position>) [read_hexbyte] Reads 2 hexadecimal digits (0..9, A..F) at the specified position in the device file and converts to an unsigned integer. For example the following would print “23 200” when “17C8” is written to the start of file PHATIO/io/dev/test

(driver test
	(keyboard (read_hexbyte 0) " " (read_hexbyte 2)))
@Contact  |   Legal & Privacy  |    RSS  |   Development Twitter  |   Official Twitter
© phatIO 2012, All Rights Reserved.