# simple oled oscilloscope # freqency test # signal pwmPin 16 > RC > analog read anIn 35 import machine from utils.octopus import * from utils.analog import Analog import array as arr octopus() signalFreq = 1000 pixel2sample = 1 div = 100 # 4085 max > ymax samples = 512 print("oled: ") XMAX = 128 YMAX = 64 o = oled_init(XMAX, YMAX) # init oled display sleep(1) o.clear() # clear pwmPin = machine.Pin(16) signal = PWM(pwmPin) # servo2 signal.freq(signalFreq) # Hz 100-1000 signal.duty(512) # signal.deinit() anIn = Analog(35)
# octopusLAB simple example # HW: ESP32 + i2c small OLED display 128x32 from time import sleep from utils.octopus import * octopus() # include main library o = oled_init(128, 32) # init oled display from utils.display_segment import displayDigit def displayNum(num, row=0): num = str(num) for n in range(len(num)): displayDigit(o, int(num[n]), n, row * 17) o.clear() for n in range(10): displayDigit(o, n, n) for n in range(10): displayDigit(o, 9 - n, n, 17) sleep(3) displayNum(314256987)
def octopus(): from utils.octopus import * octopus()