-2

I want to record data from dht11 and turn on the LED in the same code the dht11 work good by separate code the led also work well by separate code the problem is when I make it one py code problem become with error

ValueError: A different mode has already been set!

Asaad
  • 3
  • 1

1 Answers1

0

I guess you have two or more calls to GPIO.setmode().

You should only have one call to GPIO.setmode().

If one is using GPIO.BOARD and one is using GPIO.BCM you will have to choose one and amend the code to use that GPIO numbering scheme.

joan
  • 71,852
  • 5
  • 76
  • 108