Skip to content
How to turn on and off a light with python ?
Profile icon
Manceau9

What I am trying to code is not (or at least I dont think it is) very hard. I am trying to code a simple program to turn on and off a light. I will later connect it with an Arduino to turn on and off a light with my program. I need the command to control the light/LED, if you know it. I also would like to know how to give a time limit to the lighting time.

If you can help me thank you !

P.S. : I am exactly trying to make a code to make optic morse. I got the code to translate text to morse, but now I need to translate morse code into light signals. Once I will now how to turn on and off a light/LED, I think it will be easier.

You are viewing a single comment. View All
Profile icon
Coder100

you can't do that on repl.it, and no this is not easy at all.
First, you need access to the hardware, the easiest lang to do this would be something like C/C++, but if you are using raspberry pi, you could also use node.js.

Profile icon
Manceau9

@Coder100
What do you mean by hardware ?

Profile icon
Coder100

access to the light itself

@Manceau9

Profile icon
Manceau9

Ok, thanks !

@Coder100