How to set the registers of Arduino through python code to vary the sampling rate of Arduino? Can we control Arduino through python?

  • what runs the python script?
    – jsotola
    Jan 5, 2022 at 6:52

1 Answer 1


If you mean can you run a python script on a "PC" and send messages to an Arduino then yes but you would need to write code that ran on the Arduino to receive messages from the "PC" and turn those into actions on the Arduino.

If you mean can you run a python script on an Arduino directly, well yes you can there are python implementations for Arduinos, but if you go down this route you need to remember you only have a small amount of memory and you are going off piste where there will be little or no help.

Honestly I would learn how to program the arduino in C++ and stick to that.

  • 2
    welcome back Code Gorilla. you could mention Firmata
    – Juraj
    Jan 5, 2022 at 9:25
  • Thank you very much :) That was the one I had a quick look at, but I didn't investigate it in any detail so I didn't want to hint it might be any good. Jan 6, 2022 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.