Skip to main content
Arduino

Return to Answer

Commonmark migration
Source Link

Are you using your analog pins? Did you know they can be used as digital pins?

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

This is your best bet if you aren't using all your analog pins.

Are you using your analog pins? Did you know they can be used as digital pins?

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

This is your best bet if you aren't using all your analog pins.

Are you using your analog pins? Did you know they can be used as digital pins?

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

This is your best bet if you aren't using all your analog pins.

Source Link
Adam Davis
  • 678
  • 5
  • 7

Are you using your analog pins? Did you know they can be used as digital pins?

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH:

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

This is your best bet if you aren't using all your analog pins.

AltStyle によって変換されたページ (->オリジナル) /