Output Devices Week

## Displaying wind readings on an oled display ### Connecting the oled display to the Pico W I used the following tiny [oled display](https://www.amazon.com/Self-Luminous-Display-Compatible-Arduino-Raspberry/dp/B09JWN8K99/?th=1) in the fab inventory to display the wind sensor readings from an anemometer. Using I2C protocol to connect the oled display to the Pico W, I connected the following pins: | Pico W | OLED Display | | --- | --- | | 16 | SCL | | 17 | SDA | | 3V3 | VCC | | GND | GND | ### Displaying the wind readings on the oled display I used the ssd1306 library and I2C interface in micropython to display the wind readings on the oled display. I copied the following [ssd1306.py](https://github.com/stlehmann/micropython-ssd1306/blob/master/ssd1306.py) and loaded the code on the micropython device. And the micropython code for displaying to the wind sensor readings is just a few lines of code: ``` from time import sleep import utime from machine import ADC, Pin, I2C import ssd1306 i2c = I2C(0, sda=Pin(16), scl=Pin(17)) display = ssd1306.SSD1306_I2C(128, 64, i2c) wind = ADC(Pin(28)) while True: display.fill(0) digital_value = wind.read_u16() print("ADC value =", digital_value) voltage_value = 3.3 * (digital_value/65536) print("Voltage: {}V".format(voltage_value)) degrees = (voltage_value/3.1) * 360 print("Wind degree: {} degrees".format(degrees)) display.text('Wind direction', 0, 0) display.text('{} degrees'.format(int(degrees)), 0, 16) display.show() sleep(0.1) ``` Here is the final video: As noted in input devices, I would like to add a GPS module as additional input and mill the final PCB for the final project.