|
| 1 | +#!/usr/bin/env python3 |
| 2 | +"""Generates fixed voltages |
| 3 | +
|
| 4 | +Voltages can be configured via an optional JSON file |
| 5 | +""" |
| 6 | + |
| 7 | + |
| 8 | +from europi import * |
| 9 | +from europi_script import EuroPiScript |
| 10 | + |
| 11 | +import configuration |
| 12 | + |
| 13 | + |
| 14 | +class OffsetVoltages(EuroPiScript): |
| 15 | + def __init__(self): |
| 16 | + super().__init__() |
| 17 | + |
| 18 | + @classmethod |
| 19 | + def config_points(cls): |
| 20 | + """Return the static configuration options for this class |
| 21 | + """ |
| 22 | + return [ |
| 23 | + configuration.floatingPoint(name="CV1", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=0.5), |
| 24 | + configuration.floatingPoint(name="CV2", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=1.0), |
| 25 | + configuration.floatingPoint(name="CV3", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=2.0), |
| 26 | + configuration.floatingPoint(name="CV4", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=2.5), |
| 27 | + configuration.floatingPoint(name="CV5", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=5.0), |
| 28 | + configuration.floatingPoint(name="CV6", minimum=0.0, maximum=europi_config.MAX_OUTPUT_VOLTAGE, default=10.0), |
| 29 | + ] |
| 30 | + |
| 31 | + def main(self): |
| 32 | + oled.fill(0) |
| 33 | + oled.show() |
| 34 | + |
| 35 | + cv1.voltage(self.config.CV1) |
| 36 | + cv2.voltage(self.config.CV2) |
| 37 | + cv3.voltage(self.config.CV3) |
| 38 | + cv4.voltage(self.config.CV4) |
| 39 | + cv5.voltage(self.config.CV5) |
| 40 | + cv6.voltage(self.config.CV6) |
| 41 | + |
| 42 | + while True: |
| 43 | + pass |
0 commit comments