with this code
from machine import UART, Pin, I2C
from ssd1306 import SSD1306_I2C
import utime
from oled import Write, GFX, SSD1306_I2C
from oled.fonts import ubuntu_mono_15, ubuntu_mono_20
from rotary_irq_rp2 import RotaryIRQ

# Initialize UART and other peripherals
uart = UART(1, timeout=100, baudrate=56000, tx=Pin(4), rx=Pin(5), bits=8, parity=None, stop=1)
led = Pin(25, Pin.OUT)

SW = Pin(20, Pin.IN, Pin.PULL_UP)
r = RotaryIRQ(pin_num_clk=18, pin_num_dt=19, min_val=0, reverse=False, range_mode=RotaryIRQ.RANGE_UNBOUNDED)

val_old = r.value()
menu_options = ["Instructions", "Setup", "Calibration", "Help"]
current_selection = 0  # Start with the first menu item

# Push button setup
butPinValueUp = 14
myButtonValueUp = Pin(butPinValueUp, Pin.IN, Pin.PULL_UP)

butPinValueDown = 13
myButtonValueDown = Pin(butPinValueDown, Pin.IN, Pin.PULL_UP)

butPinValueReset = 10
myButtonValueReset = Pin(butPinValueReset, Pin.IN, Pin.PULL_UP)

# OLED and I2C setup
i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
oled = SSD1306_I2C(128, 64, i2c)
gfx = GFX(128, 64, oled.pixel)

# Initial values
cellValue = 100000
incValue = 100
randValue = 9
data = "awaiting input"

# Fonts
write15 = Write(oled, ubuntu_mono_15)
write20 = Write(oled, ubuntu_mono_20)

# Initial display
oled.fill(0)
write20.text("JMS AERO AG", 7, 0)
write20.text("Data Logger", 7, 20)
write20.text("Simulator", 19, 40)
oled.show()
utime.sleep(5)

for i in range(64):
    oled.scroll(0, -2)
    oled.show()
    utime.sleep_ms(10)

# Function to display the menu
def display_menu():
    oled.fill(0)  # Clear the display
    for i, option in enumerate(menu_options):
        if i == current_selection:
            oled.text(">" + option, 10, i * 10)  # Highlight selected option
        else:
            oled.text(option, 10, i * 10)
    oled.show()

# Functions for Menu Options
def instructions():
    oled.fill(0)
    write20.text("Instructions:", 0, 0)
    write15.text("1. Step A", 0, 20)
    write15.text("2. Step B", 0, 30)
    write15.text("3. Step C", 0, 40)
    oled.show()
    utime.sleep(5)  # Display for 5 seconds

def setup():
    oled.fill(0)
    write20.text("Setup Menu", 0, 0)
    write15.text("Configure options", 0, 20)
    oled.show()
    utime.sleep(5)  # Display for 5 seconds

def calibration():
    oled.fill(0)
    write20.text("Calibration Menu", 0, 0)
    write15.text("Adjust settings", 0, 20)
    oled.show()
    utime.sleep(5)  # Display for 5 seconds

def help_menu():
    oled.fill(0)
    write20.text("Help Menu", 0, 0)
    write15.text("Help information", 0, 20)
    oled.show()
    utime.sleep(5)  # Display for 5 seconds

# Main loop for handling buttons and rotary encoder
while True:
    try:
        # Update the menu display
        display_menu()

        # Check rotary encoder to navigate menu
        val_new = r.value()
        if val_old != val_new:
            # Update current selection
            current_selection = (current_selection + (val_new - val_old)) % len(menu_options)
            val_old = val_new

        # Select menu item
        if SW.value() == 0:  # If the switch button is pressed
            print("Selected:", menu_options[current_selection])
            if menu_options[current_selection] == "Instructions":
                instructions()
            elif menu_options[current_selection] == "Setup":
                setup()
            elif menu_options[current_selection] == "Calibration":
                calibration()
            elif menu_options[current_selection] == "Help":
                help_menu()

        # Check for UART data
        if uart.any():
            data = uart.readline() 
            print(data)
            if data == b'<<INITIALIZE\r\n':
                led.toggle() 
            if data == b'<<CANCEL\r\n':
                led.toggle() 
            if data == b'<<START TEST\r\n':
                led.toggle() 
            if data == b'wei.zrp\r\n':
                led.toggle() 
                uart.write("wei.zrp Zero Emulated\r\n")
                utime.sleep(1)
            if data == b'wei.mdf\r\n':
                led.toggle()
                # Fill rectangle and respond
                gfx.fill_rect(120, 0, 8, 8, 1)
                from random import randrange
                randEndValue = randrange(randValue)
                uart.write(f"wei.mdf.A:RAW:+  20617;1;ST;GS;GRO:+  {cellValue};NET:+  0.000; TAR:+  0.000;{randEndValue}e\r\n")

        utime.sleep_ms(100)  # Small delay to prevent excessive CPU usage
    except KeyboardInterrupt:
        break

which had menu added, i no longer get to see the data from the serial port. How to fix