Skip to main content
Commonmark migration
Source Link

As suggested by anonymoose's comment and RPi.GPIO's documentation RPi.GPIO module basics setting a pin to output allows to specify an initial value:

To set up a channel as an output:

 
GPIO.setup(channel, GPIO.OUT)
 

(where channel is the channel number based on the numbering system you have specified (BOARD or BCM)).

 

You can also specify an initial value for your output channel:

 
GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)

As suggested by anonymoose's comment and RPi.GPIO's documentation RPi.GPIO module basics setting a pin to output allows to specify an initial value:

To set up a channel as an output:

 
GPIO.setup(channel, GPIO.OUT)
 

(where channel is the channel number based on the numbering system you have specified (BOARD or BCM)).

 

You can also specify an initial value for your output channel:

 
GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)

As suggested by anonymoose's comment and RPi.GPIO's documentation RPi.GPIO module basics setting a pin to output allows to specify an initial value:

To set up a channel as an output:

GPIO.setup(channel, GPIO.OUT)

(where channel is the channel number based on the numbering system you have specified (BOARD or BCM)).

You can also specify an initial value for your output channel:

GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)
Source Link
Ghanima
  • 15.9k
  • 16
  • 63
  • 120

As suggested by anonymoose's comment and RPi.GPIO's documentation RPi.GPIO module basics setting a pin to output allows to specify an initial value:

To set up a channel as an output:

GPIO.setup(channel, GPIO.OUT)

(where channel is the channel number based on the numbering system you have specified (BOARD or BCM)).

You can also specify an initial value for your output channel:

GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)
Post Made Community Wiki by Ghanima