I am working on a robotics project.
I am using a jetson nano.
I have created codes for several components such as HC-SR04, two DC motors, several servo motors…

All my python codes work very well.

But when I execute the code that groups all but small code I get an error "ValueError: A different mode has already been set!

It is on line 12 of my code.

Everything is set to BOARD.

code for topic.txt (2.1 KB)
I don’t understand it.

Any help will be welcome.



hello sachamk2,

it may caused by you’d duplicate the definition, or the pin was already in used.
please refer to Configuring the 40-Pin Expansion Header for configure the pin with Jetson-IO python tool,


J’ai revérifié mes branchements et mon code.
Je ne vois pas d’erreurs potentielles.
Tout mes codes indépendants marchent avec GPIO.setmode(GPIO.BOARD).

Je ne trouve pas de solutions dans la documentation.

Vous ne voyez pas d’autre problème ?

my code : code for topic.txt (2.1 KB)

Merci d’avance




I rechecked my connections and code.
I don’t see any potential errors.
All my independent codes work with GPIO.setmode(GPIO.BOARD).

I can’t find solutions in the documentation.

My code: code for topic.txt (2.1 KB)

You don’t see any other problem?

Thank you in advance

Yours sincerely,


hello sachamk2,

please refer to Pinmux spreadsheets for the default pin configurations.
you should review your codes, please update the pin settings if necessary.