libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
1.bas
Go to the documentation of this file.
1 
15 
16 
17 #INCLUDE ONCE "BBB/pruio.bi" ' include header
18 VAR io = NEW PruIo()
19 
20 IF io->Errr ORELSE io->config() THEN ' upload settings, start IO mode
21  PRINT"config failed (" & *io->Errr & ")"
22 ELSE
23  ' here current ADC samples are available in array Adc->Value[]
24  FOR n AS LONG = 1 TO 13 ' print some lines
25  FOR i AS LONG = 1 TO 8 ' all steps
26  PRINT " " & HEX(io->Adc->Value[i], 4); ' output one channel in hex
27  NEXT
28  PRINT ' next line
29  NEXT
30 END IF
31 
32 ' we're done
33 
34 DELETE io ' destroy driver UDT
35 
36 ' help Doxygen to document the main code
37 '&/** The main function. */
38 '&int main() {PruIo::PruIo(); PruIo::config(); PruIo::~PruIo();}
39