I am using Python, Adafruit_BBIO for GPIO and PWM, Flask, and a BeagleBone Black. With all these tools and info, I have been following along in a book, "Getting Started with BeagleBone" (Richardson 2014).
With this in mind, here is my software from the text:
from flask import Flask, render_template
app = Flask(__name__)
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
PWM.start("P8_13", 0.0)
@app.route("/")
def hello():
if GPIO.input("P8_11"):
doorStatus = "open"
else:
doorStatus = "closed"
templateData = {
'doorStatus': doorStatus,
}
return render_template('main-door.html', **templateData)
@app.route('/ledLevel/<level>')
def pin_state(level):
PWM.set_duty_cycle("P8_13", float(level))
return "LED level set to " + "."
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000, debug=True)
So...I have:
Flask: v0.12.2 Python: v2.7.13
I am using the 4.9.x kernel from a Debian Distro, Stretch.
Here is my print out of the info. for the error when running the software:
![Image of Issue][1]
The terminal goes to the debugger online. I check the online debugger out and the above link is what is produced.
Seth
P.S. NameError: Global Name P8_11 is not defined.