abhi143
Posts: 129
Joined: Mon Oct 30, 2017 4:17 am

Programming for Pi

Fri Jan 05, 2018 1:54 pm

I wrote python program that can be turn on/off led

Code: Select all

import RPi.GPIO as GPIO   ## Import GPIO library 
import time               ## import Delay library 
GPIO.setmode(GPIO.BOARD)
GPIO.setup(26,GPIO.OUT)
while True:
     GPIO.output(26,True)  ##Turn on LED
     time.sleep(1)         ## wait for one second
     GPIO.output(26,False) ## Turn of LED
     time.sleep(1)
I understand to control gpio of Pi using web browser in local server. There is need to make html page and python program and the python program will run on server. and I run Apache server on Raspberry Pi3

Now I am trying to write python program that can be turn on/off led and can be run on Apache server

I have searched on internet there are some program with different server and different model. I didn't understand how to make complete python program to run on server. Should I install wiring Pi library. How to modify my program to run on Apache server ?

abhi143
Posts: 129
Joined: Mon Oct 30, 2017 4:17 am

Re: Programming for Pi

Sun Jan 07, 2018 3:24 pm

is it not good way to learn programming for raspberry Pi. I can see many tutorial to learn python programming. I am able to write simple python program for gpio of raspberry pi but I am having difficult to write server program.

How did you learn to write program for raspberry using web page ?

User avatar
Jednorozec
Posts: 809
Joined: Sun Nov 24, 2013 2:17 pm
Location: Deposit, NY

Re: Programming for Pi

Sun Jan 07, 2018 3:27 pm

You can get a web server that's written in Python. I like this one http://cherrypy.org/
Last edited by Jednorozec on Sun Jan 07, 2018 6:36 pm, edited 1 time in total.
The most important leg of a three legged stool is the one that's missing.
It's called thinking. Why don't you try it sometime?

abhi143
Posts: 129
Joined: Mon Oct 30, 2017 4:17 am

Re: Programming for Pi

Sun Jan 07, 2018 3:56 pm

Jednorozec wrote:
Sun Jan 07, 2018 3:27 pm
You can get a web server that written in Python. I like this one http://cherrypy.org/
I have done a some research on this. I can write and check simple python program on PC like I can write program for addition , print variable and come complex , then I m able to write python program for led , motor switch ..etc

Now I am trying to control gpio of pi using program. I do not understand how to do it and also I don''t want change server every time. I mean I just to use only one server how to make program workable on raspberry pi?

Return to “General discussion”