from machine import Pin, Timer, DAC
from math import *
dac = DAC(Pin(25))
Conversion_factor = (2*pi)/100
SawValues = []
x = 0
for angle in range(0,100):
SawValues.append(int(Conversion_factor))
Conversion_factor=Conversion_factor+1
def handler_0(tim0):
global SawValues
global x
dac.write(SawValues[x])
if x < 99:
x=x+1
else:
x=0
# create a variable that is a timer
tim0 = Timer(0)
# initialize and start the timer
tim0.init(period=1, mode=Timer.PERIODIC, callback=handler_0)