jojo_angelov
Posts: 38
Joined: Mon Jan 06, 2014 1:59 am

ValueError: The channel sent is invalid .." Pin 2

Sun Jun 15, 2014 3:40 am

So I have a tiny little fan connected to pin 6(Ground) and pin 2. I am trying to manually start and stop the fan when needed but I am getting this error when trying:

ValueError: The channel sent is invalid on a Raspberry Pi

Here is my code that I am executing as root. It seems to be working on other pins but not Pin 2

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)

GPIO.setup(2, GPIO.OUT, pull_up_down=GPIO.PUD_UP)
I am not sure how to access this pin. Is there something I am doing wrong?

User avatar
rpdom
Posts: 15194
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ValueError: The channel sent is invalid .." Pin 2

Sun Jun 15, 2014 5:25 am

Pin 2 is a 5 volt power pin. It is a fixed output. (actually a direct connection to the 5v input on the Pi).

Return to “Python”