GPIO Pins not receiving signal

edited November 2016 in Raspberry PI

I'm working on a project that uses GPIO output. The pins aren't getting power. Here's that part of the code:

import processing.io.*;

void setup()
{
GPIO.pinMode(5, GPIO.OUTPUT);
}

void draw()
{
GPIO.digitalWrite(5, GPIO.HIGH);
}

I know the code doesn't do much, but from what I understand, there should be 3.3 volts coming from pin 5 as a result of that code. The 5V power pins aren't even getting power. What's going on here?

Answers

  • Answer ✓

    Using the following code should be more effective for debugging. By using a mouse action, you can switch btw high and low states, instead of only testing for high in draw.

    How are you measuring the voltage across the pins?

    The following code is not tested but it should run beside minor typos, if any. I have to add I don't have experience with these boards. How are you communicating to it? If it is an external board, should you be interacting with it via serial?

    Kf

    import processing.io.*;
    
    boolean highNow=false;
    
    void setup()
    {
      size(300,200);
    textAlign(CENTER,CENTER);
      GPIO.pinMode(5, GPIO.OUTPUT);
      GPIO.digitalWrite(5, GPIO.LOW);
    }
    
    void draw(){
      text("Is current state high? " + highNow ,width/2,height/2);
    }
    
    void mouseReleased(){
      if(highNow==true)
        GPIO.digitalWrite(5, GPIO.HIGH);
      else
        GPIO.digitalWrite(5, GPIO.LOW);
    }
    
  • Answer ✓

    Something else to consider: the number 5 refers to GPIO 5, not the physical pin 5 on the pin header.

    See the pinout.

  • Answer ✓

    Forget about my comment in serial. I guess you don't need it since you are in a Raspberry pi.

    Kf

  • Thank you everyone. Problem solved. We had an insufficient power supply.

Sign In or Register to comment.