Raspberry Pi 3 GPIO not working (but RPi 2 does work!)

edited March 2017 in Raspberry PI

Hello everyone! I have written an animation that uses RPi's GPIO pins for interactivity. While this works pretty well on RPi 2, it doesn't work on the RPi 3. I used the exact same code and the same SD card that I used on the RPi 2 and double checked that the pin connections are right. The animation is nothing fancy, just displaying some images depending on some digitalRead() and digitalWrite() (like documented here: https://processing.org/reference/libraries/io/index.html) Can somebody confirm there are issues using RPi 3? Also, some more information: I used Processing 3 for development and Processing is installed on the SD card's OS (Raspbian Jessie full, not light) as well.

Thanks already for any replies, Best wishes, Shu



  • @shushustorm I am using the Pi 3 as my main development board, and using the GPIO pins always worked for me. Which particular pins are you having problems with?

    You might give our tested Raspbian image with Processing pre-installed a try as well. Please holler if this makes a difference for you.

  • edited March 2017

    @gohai Thanks for your reply! That seems odd, though.

    I am using the pins 2 and 3: int sensorTrigger = 2; int sensorEcho = 3;

    For setting pinMode and accessing them, I use code like that:

    GPIO.pinMode(sensorTrigger,GPIO.OUTPUT) GPIO.pinMode(sensorEcho,GPIO.INPUT);

    GPIO.digitalWrite(sensorTrigger,1); GPIO.digitalWrite(sensorTrigger,0); GPIO.digitalRead(sensorEcho)

    If I understand this correctly, the pin layout is the same on RPi 2 B and RPi 3 B, which I am using. But besides Processing being pre-installed, the Processing version isn't any different, is it? Because I am running the newest Raspbian OS, so it should work fine, right? Unfortunately, I don't really have much time right now to test any differences, so I will use the RPi 2 for the project that I'm working on. I just thought using RPi 3 would increase performance and setting it up would be as easy as putting in the SD card and attaching the pins. Would be great to hear any solutions, though, if somebody knows how to solve this.

  • @shushustorm GPIO pins 2 and 3 are used for the I2C bus. I haven't attempted to using those myself for GPIO, but I wouldn't be surprised if it won't work.

    Try GPIO 4 and GPIO 17 instead. https://pinout.xyz/

Sign In or Register to comment.