Analog pins won't set to digital output... Why?


hi,

i'm trying use pins a0 thru a5 on leonardo board digital outputs. defining them pinmode(14, output), example, set pin a0 output, pin a4 pin 18. reason in blink test not output a1 thru a5. a0 (as pin 14) works fine. doing wrong? here code below. code not use pin 16 (a2).


quote

int led = 13;

void setup() {               
  pinmode(led, output);   
  pinmode(15, output);
  pinmode(14, output);
  pinmode(17, output);
  pinmode(18, output); 
}


void loop() {
  digitalwrite(15, high);
  digitalwrite(14, high);
  digitalwrite(17, high);
  digitalwrite(18, high);
  digitalwrite(13, high);

  delay(500);
  digitalwrite(15, low);
  digitalwrite(14, low);
  digitalwrite(17, low);
  digitalwrite(18, low);
  digitalwrite(13, low);
  
  delay(500);
}

your code looks fine.. give try :
code: [select]


pinmode(a0, output);
digitalwrite(a0, high);


Arduino Forum > Using Arduino > Project Guidance > Analog pins won't set to digital output... Why?


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support