from machine import Pin, I2C
from utime import sleep
from ssd1306 import SSD1306_I2C
import math as m
print("Hello, Pi Pico W!")
hor = 128
ver = 64
i2c = I2C(1, sda=Pin(14), scl=Pin(15))
dsp = SSD1306_I2C(hor, ver, i2c)
r = 20
fase = 0
while True:
for x in range(-90,2700,1):
hoek = x * 2 * m.pi / 360
y = r * m.sin(hoek + fase) + ver/2
x = r * m.cos(2*hoek) + hor/2
dsp.pixel(int(x),int(y),1)
dsp.show()
fase = fase + 1
f = fase*2*m.pi/360
dsp.fill(0)