This example shows how to read analog inputs of DIABLO16 displays like uLCD-35DT, uLCD-43DT and uLCD-70DT using ViSi-Genie Magic. The uLCD-43DT was used for this sample. Three Magic Code objects were used in this sample.

MagicCode0
- The 'InsertPoint' of this Magic Code is set to 'Constant/Global/Data' since it contains the variable to store readings from PA0 and the variable to store converted readings. Also this contains a function 'map' that is used to map the analog readings to voltage equivalent.

MagicCode1
- The 'InsertPoint' of this Magic Code is set to 'PreActivateForm' since it sets pin PA0 of the display to analogue mode.

MagicCode2
- The 'InsertPoint' of this Magic Code is set to 'MainLoop' since this is where is start to read from analog then convert the value to voltage equivalent and then write the value to Led Digits and Angular Meter object.



Schematic Diagram:
Click image for larger version

Name:	4D-CD-00026.png
Views:	298
Size:	217.9 KB
ID:	45210