I would like to seek urgent help on just display what's in my database on plain html or php without any GUI interface or layout, just plain database display. Is it possible cause I'm new to it and keep struggling for a weeks already.
This is my python code:
import sqlite3
import RPi.GPIO as GPIO
import time
import datetime
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
dbname='/var/www/ledDB.db'
now = datetime.datetime.now()
timestamp = now.strftime("%Y/%m/%d %H:%M")
pin7 = "INSERT INTO led values('" + "1" + "','" + "Red LED" + "','" + timestamp + "')"
def Blink(numTimes, speed):
conn=sqlite3.connect(dbname)
curs=conn.cursor()
for i in range(numTimes):
curs.execute(pin7)
print "Iteration " + str(i + 1)
GPIO.output(7, True)
time.sleep(speed)
GPIO.output(7, False)
time.sleep(speed)
print "Done"
conn.commit()
conn.close()
GPIO.cleanup()
print "Blinking LED"
iterations = raw_input("Enter total number of times to blink: ")
speed = raw_input("Enter length of each blink(seconds): ")
Blink(int(iterations), float(speed))
Hope you guys could help me out with it as soon as possible, thanks in advance, guys.