#! /usr/bin/python3
import cgi
import cgitb
cgitb.enable()
import time
import json
import Adafruit_PCA9685
# Constants from the library
LED0_ON_L          = 0x06
LED0_ON_H          = 0x07
LED0_OFF_L         = 0x08
LED0_OFF_H         = 0x09
# This sets all PWM registers to 0
pwm = Adafruit_PCA9685.PCA9685()
print('pwm',pwm)
channel=15
lowon = pwm._device.readU8(LED0_ON_L+4*channel)
highon = pwm._device.readU8(LED0_ON_H+4*channel)
lowoff = pwm._device.readU8(LED0_OFF_L+4*channel)
highoff = pwm._device.readU8(LED0_OFF_H+4*channel)
print('Content-Type: application/json')
print()
print(json.dumps([highon, lowon, highoff, lowoff]))


