Jump to content


Photo

trying to output to analog pins

pcduino3 digital analog

  • Please log in to reply
6 replies to this topic

#1 utterlygreat

utterlygreat

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 30 October 2015 - 07:49 PM

I'm trying to output using pinMode (A0, OUTPUT) and digitalWrite(A0, HIGH), that is to use the analog pin as a digital out, but it doesn't work. I can find anything in the documentation or online related to this. 

 

Is it not possible or am I missing some essential issue?



#2 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 30 October 2015 - 11:42 PM

How are you trying to do this?

Please post some code.



#3 youkee

youkee

    Advanced Member

  • Administrators
  • 237 posts

Posted 31 October 2015 - 01:47 AM

Yes, you are right. Analog pin can not be used as digital pin.


  • utterlygreat likes this

#4 utterlygreat

utterlygreat

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 October 2015 - 11:44 AM

 @cwilt: I'm trying to raise A0 for a second using minimal code, nothing fancy, compiled with make. The code runs, but nothing happens.

#include <core.h>

void setup()
{
	pinMode(A0, OUTPUT);
}

void loop()
{
	digitalWrite(A0, HIGH);
	delay(1000);
	digitalWrite(A0, LOW);
}

@youkee: That essentially means A0 - A5 cannot be used as outputs, only inputs. Right?



#5 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 31 October 2015 - 01:15 PM

I will test it tonight and see what I find.

#6 utterlygreat

utterlygreat

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 October 2015 - 02:42 PM

Appreciate it! TNX



#7 cwilt

cwilt

    Advanced Member

  • Members
  • PipPipPip
  • 1,012 posts

Posted 01 November 2015 - 01:43 AM

youkee is correct. 

 

Sorry.


  • utterlygreat likes this





Also tagged with one or more of these keywords: pcduino3, digital, analog

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users