Friday, June 8, 2018

Analog / Digital Sample Code

Sample Code for Arduino using Any Analog / Digital Sensor



Because all analog input sensor use 0-1023 to represent data between 0V - 5V (or 3.3V), digital sensor use threshold level,

these code simply display the value it reads into serial monitor and LCD 1602 I2C display.



Connect

  • Vcc - 5V

  • GND   - GND

  • A0 - A0

  • D0 - D1   (Don't use D0 Pin in Arduino, otherwise "avrdude stk500_getsync() not in sync resp=0x30" error occured)



Code To Display Using Serial Monitor:






No comments: