12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DescriptionYou can read up to 512 bytes at a time using the Read command. If the num parameter islarger than the number of bytes remaining to be read from the file, then only the remainingbytes are returned. U<strong>se</strong> the Info command to find the current position. If the Read commandis successful, a single «sp» character is <strong>se</strong>nt, followed by the data. If an error occurs, the firstcharacter returned is ”E”, followed by an error code. Data is <strong>se</strong>nt verbatim (i.e. raw data)from the file.FormatR fh [num [addr]]Parameters• fh is a file handle (1 - 4). U<strong>se</strong> the Free Handle command to get a free file handle.• num is the number of bytes to read. Optional. If not specified, up to 512 bytes will bereturned.• addr is the address at which to start reading. Optional. num must be given for thisparameter to be u<strong>se</strong>d.Respon<strong>se</strong> Format«sp»respon<strong>se</strong> | Ennrespon<strong>se</strong> is preceded by a «sp», indicating a good read. The length of respon<strong>se</strong> is variable, anddepends on the num parameter, the position of the file handle, and the size of the file.ExampleFile handle position = 0, file size = 38 bytes:R 1«sp»13:22:02 ADC1=4.9V«cr» 13:22:32 ADC1=4.9V«cr»A sub<strong>se</strong>quent read:R 1E07Same file, read only 18 bytes (starting at address 0):Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!