Howto:Port I/O from Nasal: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 58: Line 58:
</syntaxhighlight>
</syntaxhighlight>


Now, you could also create additional wrappers to do device-specific things, like clearing the LCD screen, setting the font color, font size, positioning the cursor etc, simply by adding device specific commands to each wrapper:
<syntaxhighlight lang="php">
var setFontColor = func(color) {
sendMessage("0xFF,0xAC,0xEF....");
}
</syntaxhighlight>
<syntaxhighlight lang="php">
var setHeading = func(heading) {
sendMessage("0xFF,0xCA,0xFA,$"~heading);
}
</syntaxhighlight>


The same concept could also be used to come up with an "input property" to process results from your device.
The same concept could also be used to come up with an "input property" to process results from your device.

Navigation menu