donderdag 8 december 2011

Arduino use analog inputs as digital pin


Many people don't realise that the Arduino analog pins can be used as regular digital I/O lines simply by addressing them using a different pin number.

analog 0 = digital 14
analog 1 = digital 15
analog 2 = digital 16
analog 3 = digital 17
analog 4 = digital 18
analog 5 = digital 19

So to use, for example, analog input pin 2 as a digital pin, you can simply use a regular digital command such as:
digitalWrite( 16, HIGH );

Geen opmerkingen:

Een reactie plaatsen