12 v outputs on the mega Pi, i can get digital 10 to fire, but not A0 whats up?


What is the address of the other pins?

this works great, for one pair of outputs, but A0 has got me stumped.



Hi Kevin,

Here is the schematic of MegaPi board to you for reference.Schematic.zip (102.0 KB)


I can get the digital pins to react to code,
but the A0 output i have no luck with, i just need it to send pulses of power to a water valve.
the Digital side works great with this code, but nothing on the Analog side.


I figured it out!
you have to call the Analog pins “A0”
working code below,

// Two solenoids open staggered by 150

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(10, OUTPUT);

// the loop function runs over and over again forever
void loop() {
analogWrite(A0, 250); // Intake OPEN
delay(150);// wait for a second

analogWrite(A0, 0); //Intake CLOSE
analogWrite(13, 1032);

digitalWrite(10, 1); //Output OPEN
analogWrite(13, 250);

digitalWrite(10, 0);   //Output CLOSED

analogWrite(13, 50);