Kitruk
Hi,

I am trying to make my raspberry PI run the "Hello World" program from OpenPLC, but even tho i compile it successfully nothing happens on the board when i click the button. Posting some pictures:

jiadjas.png    

My circuit should be fine, no?

I think the problem is maybe on the openPLC runtime? This is the runtime logs i get:

OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Issued start_modbus() command to start on port: 502
Modbus Server: Listening on port 502
Modbus Server: waiting for new client...
Issued stop_dnp3() command

The status for the PLC is "Running" but nothing happens when i click the button for some reason. Anybody knows what im doing wrong?
Reply 0 0
Kitruk
Nevermind, i failed the circuit.. didn't connect the button to 3.3V. It works now!
Reply 0 0
thiagoralves
=) I was going to say the same thing, plus the fact that the resistor for the LED is also not doing anything. The resistor must be in series with your LED to protect it against over current. If not, your LED will easily burn (if it haven't already), or you may damage your Raspberry Pi's GPIO pin.

Also, it is a good idea to use a pull-down resistor on your button so that the input won't float when the button is not pressed. Without the pull-down resistor, the input can go high even when you're not pressing the button.
Reply 0 0
Kitruk
Yeah, i missed on the drawing of the resistor, the yellow cable was supposed to be on the other side of the resistor 🙂 My bad! But thanks for the tip for pull-down resistor, i guess 10k ohm will do the work for the button. 
Reply 0 0
Reply