diesmal die richtigen fuse bits und es geht nun alles mit dem internen 16Mhz Quarz .
nun zu meinem programm es erstellt am anfang zwei felder deas zweite mit cos aber 180° verschoben und zum schluss wird alles ausgegeben
mein problem derzeit ist das am ende wieder nur dauer an ankommt und kein sinus
Code:$regfile = "m8def.dat" $crystal = 16000000 '16MHz $baud = 19200 Config Portb.1 = Output Config Portb.2 = Output Dim X As Double Dim Y As Double Dim Amp As Single Amp = 100 Portb.1 = 0 Portb.2 = 0 Dim Freq As Long Freq = 1 Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up , Prescale = 1 'Compare1a Portb1 'Compare1b Portb2 Dim Cosx(360) As Byte Dim Cosy(360) As Byte Dim Cy As Single Dim Cx As Single For X = 1 To 360 Y = X + 180 Cx = Cos(x) Cx = Cx * 100 Cx = Cx + 100 Cosx(x) = Abs(cx) Cy = Cos(y) Cy = Cy * Amp Cosy(x) = Int(cy) Print X Next X Do For X = 1 To 360 Compare1a = Cosy(x) Compare1b = Cosx(x) Next X Loop End







Zitieren
Lesezeichen