Fixed error in analog sample code

Fixed two errors in analog sample code.  Changed DigitalIn to AnalogIn
and fixed how the function is called.