# Ohm Meter import LCD_24x32 as LCD from machine import ADC from time import sleep_ms a2d0 = machine.ADC(1) Navy = LCD.RGB(0,0,10) Yellow = LCD.RGB(150,150,0) LCD.Init() LCD.Clear(Navy) LCD.Box(30, 80, 330, 150, Yellow) LCD.Box(30, 180, 330, 250, Yellow) k = 3.3 / 65535 while(1): a0 = a2d0.read_u16() Volt = k*a0 Ohms = a0 / (65535 - a0) * 1000.0 LCD.Text4('Volts:', 50, 100, Yellow, Navy) LCD.Number4(Volt, 5, 3, 150, 100, Yellow, Navy) LCD.Text4('Ohms:', 50, 200, Yellow, Navy) LCD.Number4(Ohms, 6, 1, 150, 200, Yellow, Navy) print(Volt, Ohms) sleep_ms(200)