Example #1
0
# process delay (delay loop by X seconds to slow necessary computing)
PROCESS_DELAY = 1
# manual time test limit
MANUAL_TIME_LIMIT = 300
WINDOW_CHECK_INTERVAL = 5

# peripheral i2c bus addresses
RTC_ADD = 0x68

# read config, get constants, etc
print("Initializing...")
static_master = SM.StaticMaster()
usb_master = DM.USBMaster()
test_master = TM.TestingMaster(static_master.get_config())
print(usb_master.get_USB_path())
csv_master = DM.CSVMaster(usb_master.get_USB_path())
adc_master = TM.ADCMaster()
pow_master = TM.PowerMaster()
irr_master = SP420.Irradiance()
pr_master = TM.PerformanceRatio()

# channel setup

# RTC setup
i2c_bus = busio.I2C(SCL, SDA)
rtc = adafruit_pcf8523.PCF8523(i2c_bus)

# set time to current if needed
#time struct: (year, month, month_day, hour, min, sec, week_day {Monday=0}, year_day, is_daylightsaving?)
# run this once with the line below uncommented
#rtc.datetime = time.struct_time((2019,7,5,12,8,0,0,173,1))