PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Datentypen



Thomas$
28.06.2009, 14:33
Hallo hab mal wieder ne frage.
gibt es eine zusammen fassung der datentypen von bascom. ich glaub genau da liegt ein fehler in meinem programm, dass ich den falschen daten typ in einer rechen operation liegt den mit a=a+1 ereich ich nie eine komma zahl

magnetix48
28.06.2009, 14:52
Hallo,

schau mal in der Bascom Hilfe unter "Language Fundamentals" nach.

Gruß
magnetix48

Thomas$
28.06.2009, 15:02
ah thx ich komm mit der hilf von bascom sonst nich wirklich klar habs jetzt aber doch gefunden

Thomas$
28.06.2009, 15:21
der misst will immer noch nich ich hab bei meinen rechnungen 0 raus obwohl sie unter vb gehen (hab sie dort extra noch mal getestet)

Thomas$
28.06.2009, 15:54
gibt es irgendwelche kombinatinen wo null raus kommt? z.B. double+integer
oder gibts noch irgend eine möglich keit die mir mein ergebniss auf null setzt ich hab alle variablen mit dim as blabla
festgelegt

peterfido
28.06.2009, 16:10
Wäre von Vortiel ein bissel Code zu posten... Ich versuche so weit wie möglich zu vermeiden mit unterschiedliche Datentypen zu rechnen.

Thomas$
28.06.2009, 16:20
$regfile = "m16def.dat"
$crystal = 7372800
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim Comfeld(12) As Byte
Dim X As Double
Dim Y As Integer
Dim Z As Integer
Dim W As Byte
Dim K As Byte
Dim M As Double
Dim N As Double
Dim Auflosung As Integer
Dim Xstart As Integer
Dim Ystart As Integer
Dim Zstart As Integer

Dim Xziel As Integer
Dim Yziel As Integer
Dim Zziel As Integer
Dim Zwischenwert1 As Double
Dim Zwischenwert2 As Double
Dim Zwischenwert3 As Double
Dim Zwischenwert4 As Double
Dim Zwischenwert5 As Double
Dim Zwischenwert6 As Double
Dim Aa As Single
Dim Bb As Single

Dim Xzwischenziel As Integer
Dim Yzwischenziel As Integer
Dim Zzwischenziel As Integer
Dim Realposx As Integer
Dim Realposy As Integer
Dim Realposz As Integer
Dim Stposx As Integer
Dim Stposy As Integer
Dim Stposz As Integer
Dim Motoraus As Long
Dim Absx As Integer
Dim Absy As Integer
Dim Absz As Integer
Dim Pc1alt As Byte
Dim Pc0alt As Byte
Dim F0 As Bit
Dim F1 As Bit : Dim F2 As Bit : Dim F3 As Bit : Dim F4 As Bit
Dim F5 As Bit : Dim F6 As Bit : Dim F7 As Bit : Dim F8 As Bit

Auflosung = 2
Config Porta = Output
Config Portd = Input
'Config Portd.6 = Output
Config Portc = Input
Config Portb.1 = Input
Config Portb.0 = Output
Realposx = 1
Realposy = 1
Realposz = 1

'Enable

Xziel = 500
Yziel = 50
Porta = 255

Portc = 255
Stposx = 1 'Realposx
Stposy = 1 'Realposy
Stposz = 1 'Realposz


For Aa = 0 To 1 Step 0.2
Bb = Aa - 2

Zwischenwert1 = Stposx * Bb
Zwischenwert2 = Xziel * Aa
Zwischenwert3 = Stposy * Bb
Zwischenwert4 = Yziel * Aa
Zwischenwert5 = Zwischenwert2 - Zwischenwert1 'zwischen punkt erechnungs zeug
Zwischenwert6 = zwischenwert4 - Zwischenwert3

X = Zwischenwert5 / 2 'realpos damit ich immer vom wirklichen wert ausgehe und der fehler nicht größer wird
Y = Zwischenwert6 / 2
' x= realpos-x
'X = 50.5
Motoraus = 0
If X = 0 Then : Porta.0 = 0 : Else : Porta.0 = 1 : End If
Do
If Pinc.0 = 0 Then Pc0alt = 1
If Pinc.0 = 1 And Pc0alt = 1 Then : Pc0alt = 0 : X = X + 1 : Realposx = Realposx + 1 : End If 'pos holen

If Pinc.1 = 0 Then Pc1alt = 1
If Pinc.1 = 1 And Pc1alt = 1 Then : Pc1alt = 0 : X = X - 1 : Realposx = Realposx -1 : End If 'pos holen
If X = 0 Then : Porta.1 = 0 : Else : Porta.1 = 1 : End If

Absx = Abs(x)

If X > 0 Then : Porta.4 = 0 : Porta.5 = 1 : Waitus 50 : End If 'Pos anfahren
If X < 0 Then : Porta.4 = 1 : Porta.5 = 0 : Waitus 50 : End If 'pos anfahre
If Absx < 15 Then : Porta.4 = 0 : Porta.5 = 0 : End If
If X = 0 Then Motoraus = Motoraus + 1
Loop 'Until Motoraus = 9000
Next Aa
Do
Loop


If X = 0 Then : Porta.0 = 0 : Else : Porta.0 = 1 : End If
Daran sehe ich das x=0 ist nagut noch bissel zur funktion es wird mal ne steuerung für ne fräsmaschiene die xzielund yziel .. wird über rs232 gesendet und dann soll die pos angefahren es werden normale lego motoren verwendet und die zwischen punkt erechnung funktioniert halt nich nur in vb

stefan_Z
28.06.2009, 16:53
Setze mal die Stacks hoch. Ist immer gut - ein gern gemachter Fehler ;-)
Wenn das nicht reicht, dann löse die IF/THEN Dinger mal in Einzelzeilen auf.
Ansonsten Simulator anwerfen...

Thomas$
28.06.2009, 17:21
so $hwstack = 32 ' default use 32 for the hardware stack

$swstack = 10 ? welche werte?

edit das if then zeugs geht ja wenn ich x=50 vor do......Loop hab fährt der motor den punkt an

Thomas$
28.06.2009, 18:01
jetzt geht der simulator nicht mehr

MeckPommER
28.06.2009, 18:28
Bascom macht meistens Murks, wenn in einer Rechenoperation auch noch eine Typenkonvertierung erfolgen soll. Beispiel:

Dim a as integer
Dim b as single

geht nicht:
a = 2 * b

geht:
b=b*2
a=b

Gruß MeckPommER

Thomas$
28.06.2009, 18:36
nagut schöne scheise ich hab mich schon doof und dämlich gesucht werd den mist nochmal umschreiben und dann weiter sehen

MeckPommER
28.06.2009, 18:45
Jeder Fehler macht einen schlauer ... ich habe auch mal nen Tag grummelig verdaddelt, weil ich das nicht wußte ^^

Aber so ist das, wenn man besonders schnell sein möchte.

Generell würde ich Typenkonvertierungen vermeiden. Warum nicht alles in Single anstatt Integer und Double? Die Typenkonvertierung verschlingt mehr Zeit, als das Rechnen in Single anstatt Integer.

Thomas$
28.06.2009, 19:49
das problem die position ist ganz zahlig aber in der berechnung sind kommazahlen drin.

for_ro
28.06.2009, 20:17
das problem die position ist ganz zahlig aber in der berechnung sind kommazahlen drin.
Dann mach doch deine ganze Berechnung mit float und erst wenn du die Position als ganze Zahl brauchst wandelst du um.
Wie Meckpommer schon sagt, Typ wandeln und rechnen unterstützt Bascom nicht.

Gruß

Rolf

Thomas$
28.06.2009, 20:35
mach ich ja jetzt seit dem ich weiß das es nich geht aber jetzt macht der atmega 8 noch tollere sachen ich hab die positionen zum test in array gespeichert nach dem er die erste pos angefahren hat fängt er an meine leds zum blinken zu bringen und den motor" wackeln" irgendwas schwingt

MeckPommER
28.06.2009, 20:40
Ohne Code ... ist die Antwort wie immer 42 ;-)

Thomas$
28.06.2009, 20:49
den wollt ich erstmal zusamen kürzen weil sonst zuviel unnötiges drinsteht. und dabei hab ich den fehler behoben. weiß aber immer noch nich was daran schuld war. um das problem der zwischen punkte bissel zu erleichtern wollt ich die zwischen werte speichern und dann abfahren. wie bekomm ich ein möglichst großes feld mit werten des typs long. oder wie groß kann man es machen?

for_ro
28.06.2009, 21:00
So groß wie dein SRAM ist oder auch noch XRAM.
Indices von Arrays gehen bis 65535.

Gruß

Rolf

Thomas$
28.06.2009, 21:16
sram 1k Byte 512 bytes eeprom 16 k bytes flash zum programieren was über xram hab ich nich gefunden

Thomas$
29.06.2009, 10:44
den eeprom kann man ja 100.000 mal beschreiben wie schnell schaft man das erfahrungs gemäß? strat und zielpunkt speicher ich jetzt darauf und die zwischen punkte auf den sram (der hat keine grenze?)

Thomas$
02.07.2009, 22:44
hab alles auf doubel gesetzt und am ende trozdem 0 raus :-k

for_ro
02.07.2009, 23:23
Poste doch noch mal dein aktuelles Programm.
Dann brauchen wir nicht zu raten, wie es jetzt aussieht, sondern können es direkt austesten.

Gruß

Rolf

Thomas$
03.07.2009, 09:16
$regfile = "m16def.dat"
$crystal = 7372800
Dim A As Double
Dim B As Double
Dim C As Double
Dim Comfeld(12) As Byte
Dim X As Double
Dim Y As Double
Dim Z As Double
Dim W As Double
Dim K As Double
Dim M As Double
Dim N As Double
Dim Auflosung As Double
Dim Xstart As Integer
Dim Ystart As Integer
Dim Zstart As Integer

Dim Xziel As Double
Dim Yziel As Double
Dim Zziel As Double
Dim Zwischenwert1 As Double
Dim Zwischenwert2 As Double
Dim Zwischenwert3 As Double
Dim Zwischenwert4 As Double
Dim Zwischenwert5 As Double
Dim Zwischenwert6 As Double
Dim Aa As Double
Dim Bb As Double

Dim Xzwischenziel As Double
Dim Yzwischenziel As Double
Dim Zzwischenziel As Double
Dim Realposx As Integer
Dim Realposy As Integer
Dim Realposz As Integer
Dim Stposx As Double
Dim Stposy As Double
Dim Stposz As Double
Dim Motoraus As Double
Dim Absx As Double
Dim Absy As Double
Dim Absz As Double
Dim Pc1alt As Double
Dim Pc0alt As Double
Dim F0 As Bit
Dim F1 As Bit : Dim F2 As Bit : Dim F3 As Bit : Dim F4 As Bit
Dim F5 As Bit : Dim F6 As Bit : Dim F7 As Bit : Dim F8 As Bit

Auflosung = 2
Config Porta = Output
Config Portd = Input
'Config Portd.6 = Output
Config Portc = Input
Config Portb.1 = Input
Config Portb.0 = Output
Realposx = 1
Realposy = 1
Realposz = 1

'Enable

Xziel = 300 '10 umdreungen
Yziel = 30
Porta = 255

Portc = 255
Stposx = 1 'Realposx
Stposy = 1 'Realposy
Stposz = 1 'Realposz


For Aa = 0 To 2 Step 0.1
Bb = Aa - 2

Zwischenwert1 = Stposx * Bb
Zwischenwert2 = Xziel * Aa
Zwischenwert3 = Stposy * Bb
Zwischenwert4 = Yziel * Aa
Zwischenwert5 = Zwischenwert2 - Zwischenwert1 'zwischen punkt erechnungs zeug
Zwischenwert6 = zwischenwert4 - Zwischenwert3

X = Zwischenwert5 / 2 'realpos damit ich immer vom wirklichen wert ausgehe und der fehler nicht größer wird
Y = Zwischenwert6 / 2

'X = 50.5
Motoraus = 0
X = Int(x)
X = X - Realpos
If X = 0 Then : Porta.0 = 0 : Else : Porta.0 = 1 : End If 'test ob x null ist
Do
If Pinc.0 = 0 Then Pc0alt = 1
If Pinc.0 = 1 And Pc0alt = 1 Then : Pc0alt = 0 : X = X + 1 : Realposx = Realposx + 1 : End If 'pos holen

If Pinc.1 = 0 Then Pc1alt = 1
If Pinc.1 = 1 And Pc1alt = 1 Then : Pc1alt = 0 : X = X - 1 : Realposx = Realposx -1 : End If 'pos holen
If X = 0 Then : Porta.1 = 0 : Else : Porta.1 = 1 : End If

Absx = Abs(x)

If X > 0 Then : Porta.4 = 0 : Porta.5 = 1 : Waitus 50 : End If 'Pos anfahren
If X < 0 Then : Porta.4 = 1 : Porta.5 = 0 : Waitus 50 : End If 'pos anfahre
If Absx < 15 Then : Porta.4 = 0 : Porta.5 = 0 : End If
If X = 0 Then Motoraus = Motoraus + 1
Loop Until Motoraus = 1000 'sicher gehen das der motor wirklich steht und keinen schwung mehr hat
Next Aa
Do
Loop



das ist er gestern ging garnichts der test ob x null ist war positiv die led leuchtete jetzt gehts nur das der motor ein paar um drehungen mehr macht (schätze 10* soviele) noch was pinc0 bekommt die impulse der geberscheibe wenn der motor sich nach rechts dreht und pinc1 wenn er sich nach links dreht also die geber scheibe und die lichschranken haben auch noch eine logik die geht aber 100%ig

for_ro
03.07.2009, 21:11
In Zeile 90 steht
X = X - Realpos
Realpos ist nicht definiert. Seltsamerweise beschwert sich der Compiler nicht. Habe ich bisher noch nie gehabt. In der Simulation hat Realpos den Wert 3, keine Ahnung warum.
Wahrscheinlich meinst du
X = X - RealPosx

Gruß

Rolf

Thomas$
03.07.2009, 21:43
ja meinte ich. tippfehler da kann ich mich ja doof und dämlich suchen der compiler brüllt bei allem außer eine variable ist nicht definiert. werd es mal testen

test fehlgeschlagen der fehler bleibt der selbe

Thomas$
03.07.2009, 21:59
x ist ja ein absolutes ziel und realposx mein absolute postion und um den weg zu erechnen mach ich ja X = X - Realposx trotzdem scheint er immer den weg immer wieder neu zu fahren als wäre meine absolute position immer noch 0 (versteht ihr was ich meine hab mein problem das zu beschreiben) der müsste 10 umdrehungen mach er macht aber über 70 dann wurd ich abgelenkt dauerte aber nicht mehr lange also müssten um die 100 gewesen sein

Thomas$
04.07.2009, 21:53
das geht aber zu machen oder hat da bascom wieder ein problem damit z.B.
a as word
b as word
c as word
a=1
b=2
c=a/b

dann ist c 0
a=3
b=2
c=a/b
ist c 1 oder kann es sein das der auch auf die idee kommt 0 zu machen weil c eigentlich 1,5 ist und damit kein word und der wider eine datentyp umformung machen will

Thomas$
04.07.2009, 23:18
es geht hab zwar immer noch meine schwierig keiten mit den datentypen aber es geht hier der code der ist jetzt so gemacht das ich in der einen for next schleicf nicht merh +0.1 mach sondern nur noch ganzahlige wert sodas alles keine gleit kommas mehr brauch wer noch paar optimierungs vorschläge machen kann und will die mir nicht das ganze programm auf den kopfstelle.

$regfile = "m16def.dat"
$crystal = 7372800
Dim A As Double
Dim B As Double
Dim C As Double
Dim Comfeld(12) As Byte
Dim X As Long
Dim Y As Long
Dim Z As Double
Dim W As Double
Dim K As Double
Dim M As Double
Dim N As Double
Dim Auflosung As Long
Dim Xstart As Long
Dim Ystart As Long
Dim Zstart As Long

Dim Xziel As Long
Dim Yziel As Long
Dim Zziel As Long
Dim Zwischenwert1 As Long
Dim Zwischenwert2 As Long
Dim Zwischenwert3 As Long
Dim Zwischenwert4 As Long
Dim Zwischenwert5 As Long
Dim Zwischenwert6 As Long
Dim Aa As Long
Dim Bb As Long

Dim Xzwischenziel As Double
Dim Yzwischenziel As Double
Dim Zzwischenziel As Double
Dim Realposx As Long
Dim Realposy As Long
Dim Realposz As Long
Dim Stposx As Long
Dim Stposy As Long
Dim Stposz As Long
Dim Motoraus As Long
Dim Absx As Long
Dim Absy As Long
Dim Absz As Long
Dim Pc1alt As Long
Dim Pc0alt As Long
Dim F0 As Bit
Dim F1 As Bit : Dim F2 As Bit : Dim F3 As Bit : Dim F4 As Bit
Dim F5 As Bit : Dim F6 As Bit : Dim F7 As Bit : Dim F8 As Bit

Auflosung = 2
Config Porta = Output
Config Portd = Input
'Config Portd.6 = Output
Config Portc = Input
Config Portb.1 = Input
Config Portb.0 = Output
Realposx = 1
Realposy = 1
Realposz = 1

'Enable

Xziel = 120 '10 umdreungen
Yziel = 30
Porta = 255

Portc = 255
Stposx = 1 'Realposx
Stposy = 1 'Realposy
Stposz = 1 'Realposz


For Aa = 0 To 20 Step 5
Bb = Aa - 20

Zwischenwert1 = Stposx * Bb
Zwischenwert2 = Xziel * Aa
Zwischenwert3 = Stposy * Bb
Zwischenwert4 = Yziel * Aa
Zwischenwert5 = Zwischenwert2 - Zwischenwert1 'zwischen punkt erechnungs zeug
Zwischenwert6 = Zwischenwert4 - Zwischenwert3

X = Zwischenwert5 / 2 'realpos damit ich immer vom wirklichen wert ausgehe und der fehler nicht größer wird
Y = Zwischenwert6 / 2

X = X / 10
Y = Y / 10
'X = 50.5
Motoraus = 0
'X = Int(x)
X = X - Realposx
If X = 0 Then : Porta.0 = 0 : Else : Porta.0 = 1 : End If
Do
If Pinc.0 = 0 Then Pc0alt = 1
If Pinc.0 = 1 And Pc0alt = 1 Then : Pc0alt = 0 : X = X + 1 : Realposx = Realposx - 1 : End If 'pos holen

If Pinc.1 = 0 Then Pc1alt = 1
If Pinc.1 = 1 And Pc1alt = 1 Then : Pc1alt = 0 : X = X - 1 : Realposx = Realposx + 1 : End If 'pos holen
If X = 0 Then : Porta.1 = 0 : Else : Porta.1 = 1 : End If

Absx = X 'abs(x)

If X > 0 Then : Porta.4 = 0 : Porta.5 = 1 : Waitus 50 : End If 'Pos anfahren
If X < 0 Then : Porta.4 = 1 : Porta.5 = 0 : Waitus 50 : End If 'pos anfahre
If Absx < 15 Then : Porta.4 = 0 : Porta.5 = 0 : End If
If X = 0 Then Motoraus = Motoraus + 1
Loop Until Motoraus = 1000 'sicher gehen das der motor wirklich steht und keinen schwung mehr hat
Next Aa
Do
Loop

Thomas$
29.07.2009, 15:53
der neue atmega8 von pollin ist eigetroffen und da wollt ich jetzt wissen was ich machen muss das der atmega8 den externen 16MHz quarz verwendet und nicht den 1MHz internen rc oszilator.

Thomas$
29.07.2009, 21:59
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

$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

Thomas$
30.07.2009, 22:15
da ich den datentypen kombinationen nicht herr geworden bin und desto mehr ich rechne immer häufiger null rauskommt hab ich mir in veb ein programm geschrieben das mir eine sinus tabelle anleget und ich hab das also nicht alles per hand eingetippt. und hier der code er funktioniert ist aber für hohe frequense ungeeignet.
$regfile = "m8def.dat"
$crystal = 16000000 '16MHz
$baud = 19200



Config Portb.1 = Output
Config Portb.2 = Output
Dim X As Long
Dim Csy(722) As Byte
Dim Csyy As Byte
Dim Wart As Long
Csy(1) = 128
csy( 2) = 130
csy( 3) = 132
csy( 4) = 134
csy( 5) = 136
csy( 6) = 139
csy( 7) = 141
csy( 8) = 143
csy( 9) = 145
csy( 10) = 147
csy( 11) = 150
csy( 12) = 152
csy( 13) = 154
csy( 14) = 156
csy( 15) = 158
csy( 16) = 160
csy( 17) = 163
csy( 18) = 165
csy( 19) = 167
csy( 20) = 169
csy( 21) = 171
csy( 22) = 173
csy( 23) = 175
csy( 24) = 177
csy( 25) = 179
csy( 26) = 181
csy( 27) = 183
csy( 28) = 185
csy( 29) = 187
csy( 30) = 189
csy( 31) = 191
csy( 32) = 193
csy( 33) = 195
csy( 34) = 197
csy( 35) = 199
csy( 36) = 200
csy( 37) = 202
csy( 38) = 204
csy( 39) = 206
csy( 40) = 207
csy( 41) = 209
csy( 42) = 211
csy( 43) = 212
csy( 44) = 214
csy( 45) = 216
csy( 46) = 217
csy( 47) = 219
csy( 48) = 220
csy( 49) = 222
csy( 50) = 223
csy( 51) = 225
csy( 52) = 226
csy( 53) = 228
csy( 54) = 229
csy( 55) = 230
csy( 56) = 232
csy( 57) = 233
csy( 58) = 234
csy( 59) = 235
csy( 60) = 236
csy( 61) = 237
csy( 62) = 239
csy( 63) = 240
csy( 64) = 241
csy( 65) = 242
csy( 66) = 243
csy( 67) = 244
csy( 68) = 244
csy( 69) = 245
csy( 70) = 246
csy( 71) = 247
csy( 72) = 248
csy( 73) = 248
csy( 74) = 249
csy( 75) = 250
csy( 76) = 250
csy( 77) = 251
csy( 78) = 251
csy( 79) = 252
csy( 80) = 252
csy( 81) = 253
csy( 82) = 253
csy( 83) = 253
csy( 84) = 254
csy( 85) = 254
csy( 86) = 254
csy( 87) = 254
csy( 88) = 254
csy( 89) = 254
csy( 90) = 254
csy( 91) = 255
csy( 92) = 254
csy( 93) = 254
csy( 94) = 254
csy( 95) = 254
csy( 96) = 254
csy( 97) = 254
csy( 98) = 254
csy( 99) = 253
csy( 100) = 253
csy( 101) = 253
csy( 102) = 252
csy( 103) = 252
csy( 104) = 251
csy( 105) = 251
csy( 106) = 250
csy( 107) = 250
csy( 108) = 249
csy( 109) = 248
csy( 110) = 248
csy( 111) = 247
csy( 112) = 246
csy( 113) = 245
csy( 114) = 244
csy( 115) = 244
csy( 116) = 243
csy( 117) = 242
csy( 118) = 241
csy( 119) = 240
csy( 120) = 239
csy( 121) = 237
csy( 122) = 236
csy( 123) = 235
csy( 124) = 234
csy( 125) = 233
csy( 126) = 232
csy( 127) = 230
csy( 128) = 229
csy( 129) = 228
csy( 130) = 226
csy( 131) = 225
csy( 132) = 223
csy( 133) = 222
csy( 134) = 220
csy( 135) = 219
csy( 136) = 217
csy( 137) = 216
csy( 138) = 214
csy( 139) = 212
csy( 140) = 211
csy( 141) = 209
csy( 142) = 207
csy( 143) = 206
csy( 144) = 204
csy( 145) = 202
csy( 146) = 200
csy( 147) = 199
csy( 148) = 197
csy( 149) = 195
csy( 150) = 193
csy( 151) = 191
csy( 152) = 189
csy( 153) = 187
csy( 154) = 185
csy( 155) = 183
csy( 156) = 181
csy( 157) = 179
csy( 158) = 177
csy( 159) = 175
csy( 160) = 173
csy( 161) = 171
csy( 162) = 169
csy( 163) = 167
csy( 164) = 165
csy( 165) = 163
csy( 166) = 160
csy( 167) = 158
csy( 168) = 156
csy( 169) = 154
csy( 170) = 152
csy( 171) = 150
csy( 172) = 147
csy( 173) = 145
csy( 174) = 143
csy( 175) = 141
csy( 176) = 139
csy( 177) = 136
csy( 178) = 134
csy( 179) = 132
csy( 180) = 130
csy( 181) = 128
csy( 182) = 125
csy( 183) = 123
csy( 184) = 121
csy( 185) = 119
csy( 186) = 116
csy( 187) = 114
csy( 188) = 112
csy( 189) = 110
csy( 190) = 108
csy( 191) = 105
csy( 192) = 103
csy( 193) = 101
csy( 194) = 99
csy( 195) = 97
csy( 196) = 95
csy( 197) = 92
csy( 198) = 90
csy( 199) = 88
csy( 200) = 86
csy( 201) = 84
csy( 202) = 82
csy( 203) = 80
csy( 204) = 78
csy( 205) = 76
csy( 206) = 74
csy( 207) = 72
csy( 208) = 70
csy( 209) = 68
csy( 210) = 66
csy( 211) = 64
csy( 212) = 62
csy( 213) = 60
csy( 214) = 58
csy( 215) = 56
csy( 216) = 55
csy( 217) = 53
csy( 218) = 51
csy( 219) = 49
csy( 220) = 48
csy( 221) = 46
csy( 222) = 44
csy( 223) = 43
csy( 224) = 41
csy( 225) = 39
csy( 226) = 38
csy( 227) = 36
csy( 228) = 35
csy( 229) = 33
csy( 230) = 32
csy( 231) = 30
csy( 232) = 29
csy( 233) = 27
csy( 234) = 26
csy( 235) = 25
csy( 236) = 23
csy( 237) = 22
csy( 238) = 21
csy( 239) = 20
csy( 240) = 19
csy( 241) = 18
csy( 242) = 16
csy( 243) = 15
csy( 244) = 14
csy( 245) = 13
csy( 246) = 12
csy( 247) = 11
csy( 248) = 11
csy( 249) = 10
csy( 250) = 9
csy( 251) = 8
csy( 252) = 7
csy( 253) = 7
csy( 254) = 6
csy( 255) = 5
csy( 256) = 5
csy( 257) = 4
csy( 258) = 4
csy( 259) = 3
csy( 260) = 3
csy( 261) = 2
csy( 262) = 2
csy( 263) = 2
csy( 264) = 1
csy( 265) = 1
csy( 266) = 1
csy( 267) = 1
csy( 268) = 1
csy( 269) = 1
csy( 270) = 1
csy( 271) = 1
csy( 272) = 1
csy( 273) = 1
csy( 274) = 1
csy( 275) = 1
csy( 276) = 1
csy( 277) = 1
csy( 278) = 1
csy( 279) = 2
csy( 280) = 2
csy( 281) = 2
csy( 282) = 3
csy( 283) = 3
csy( 284) = 4
csy( 285) = 4
csy( 286) = 5
csy( 287) = 5
csy( 288) = 6
csy( 289) = 7
csy( 290) = 7
csy( 291) = 8
csy( 292) = 9
csy( 293) = 10
csy( 294) = 11
csy( 295) = 11
csy( 296) = 12
csy( 297) = 13
csy( 298) = 14
csy( 299) = 15
csy( 300) = 16
csy( 301) = 18
csy( 302) = 19
csy( 303) = 20
csy( 304) = 21
csy( 305) = 22
csy( 306) = 23
csy( 307) = 25
csy( 308) = 26
csy( 309) = 27
csy( 310) = 29
csy( 311) = 30
csy( 312) = 32
csy( 313) = 33
csy( 314) = 35
csy( 315) = 36
csy( 316) = 38
csy( 317) = 39
csy( 318) = 41
csy( 319) = 43
csy( 320) = 44
csy( 321) = 46
csy( 322) = 48
csy( 323) = 49
csy( 324) = 51
csy( 325) = 53
csy( 326) = 55
csy( 327) = 56
csy( 328) = 58
csy( 329) = 60
csy( 330) = 62
csy( 331) = 64
csy( 332) = 66
csy( 333) = 68
csy( 334) = 70
csy( 335) = 72
csy( 336) = 74
csy( 337) = 76
csy( 338) = 78
csy( 339) = 80
csy( 340) = 82
csy( 341) = 84
csy( 342) = 86
csy( 343) = 88
csy( 344) = 90
csy( 345) = 92
csy( 346) = 95
csy( 347) = 97
csy( 348) = 99
csy( 349) = 101
csy( 350) = 103
csy( 351) = 105
csy( 352) = 108
csy( 353) = 110
csy( 354) = 112
csy( 355) = 114
csy( 356) = 116
csy( 357) = 119
csy( 358) = 121
csy( 359) = 123
csy( 360) = 125
csy( 361) = 127
csy( 362) = 130
csy( 363) = 132
csy( 364) = 134
csy( 365) = 136
csy( 366) = 139
csy( 367) = 141
csy( 368) = 143
csy( 369) = 145
csy( 370) = 147
csy( 371) = 150
csy( 372) = 152
csy( 373) = 154
csy( 374) = 156
csy( 375) = 158
csy( 376) = 160
csy( 377) = 163
csy( 378) = 165
csy( 379) = 167
csy( 380) = 169
csy( 381) = 171
csy( 382) = 173
csy( 383) = 175
csy( 384) = 177
csy( 385) = 179
csy( 386) = 181
csy( 387) = 183
csy( 388) = 185
csy( 389) = 187
csy( 390) = 189
csy( 391) = 191
csy( 392) = 193
csy( 393) = 195
csy( 394) = 197
csy( 395) = 199
csy( 396) = 200
csy( 397) = 202
csy( 398) = 204
csy( 399) = 206
csy( 400) = 207
csy( 401) = 209
csy( 402) = 211
csy( 403) = 212
csy( 404) = 214
csy( 405) = 216
csy( 406) = 217
csy( 407) = 219
csy( 408) = 220
csy( 409) = 222
csy( 410) = 223
csy( 411) = 225
csy( 412) = 226
csy( 413) = 228
csy( 414) = 229
csy( 415) = 230
csy( 416) = 232
csy( 417) = 233
csy( 418) = 234
csy( 419) = 235
csy( 420) = 236
csy( 421) = 237
csy( 422) = 239
csy( 423) = 240
csy( 424) = 241
csy( 425) = 242
csy( 426) = 243
csy( 427) = 244
csy( 428) = 244
csy( 429) = 245
csy( 430) = 246
csy( 431) = 247
csy( 432) = 248
csy( 433) = 248
csy( 434) = 249
csy( 435) = 250
csy( 436) = 250
csy( 437) = 251
csy( 438) = 251
csy( 439) = 252
csy( 440) = 252
csy( 441) = 253
csy( 442) = 253
csy( 443) = 253
csy( 444) = 254
csy( 445) = 254
csy( 446) = 254
csy( 447) = 254
csy( 448) = 254
csy( 449) = 254
csy( 450) = 254
csy( 451) = 255
csy( 452) = 254
csy( 453) = 254
csy( 454) = 254
csy( 455) = 254
csy( 456) = 254
csy( 457) = 254
csy( 458) = 254
csy( 459) = 253
csy( 460) = 253
csy( 461) = 253
csy( 462) = 252
csy( 463) = 252
csy( 464) = 251
csy( 465) = 251
csy( 466) = 250
csy( 467) = 250
csy( 468) = 249
csy( 469) = 248
csy( 470) = 248
csy( 471) = 247
csy( 472) = 246
csy( 473) = 245
csy( 474) = 244
csy( 475) = 244
csy( 476) = 243
csy( 477) = 242
csy( 478) = 241
csy( 479) = 240
csy( 480) = 239
csy( 481) = 237
csy( 482) = 236
csy( 483) = 235
csy( 484) = 234
csy( 485) = 233
csy( 486) = 232
csy( 487) = 230
csy( 488) = 229
csy( 489) = 228
csy( 490) = 226
csy( 491) = 225
csy( 492) = 223
csy( 493) = 222
csy( 494) = 220
csy( 495) = 219
csy( 496) = 217
csy( 497) = 216
csy( 498) = 214
csy( 499) = 212
csy( 500) = 211
csy( 501) = 209
csy( 502) = 207
csy( 503) = 206
csy( 504) = 204
csy( 505) = 202
csy( 506) = 200
csy( 507) = 199
csy( 508) = 197
csy( 509) = 195
csy( 510) = 193
csy( 511) = 191
csy( 512) = 189
csy( 513) = 187
csy( 514) = 185
csy( 515) = 183
csy( 516) = 181
csy( 517) = 179
csy( 518) = 177
csy( 519) = 175
csy( 520) = 173
csy( 521) = 171
csy( 522) = 169
csy( 523) = 167
csy( 524) = 165
csy( 525) = 163
csy( 526) = 160
csy( 527) = 158
csy( 528) = 156
csy( 529) = 154
csy( 530) = 152
csy( 531) = 150
csy( 532) = 147
csy( 533) = 145
csy( 534) = 143
csy( 535) = 141
csy( 536) = 139
csy( 537) = 136
csy( 538) = 134
csy( 539) = 132
csy( 540) = 130
csy( 541) = 128
csy( 542) = 125
csy( 543) = 123
csy( 544) = 121
csy( 545) = 119
csy( 546) = 116
csy( 547) = 114
csy( 548) = 112
csy( 549) = 110
csy( 550) = 108
csy( 551) = 105
csy( 552) = 103
csy( 553) = 101
csy( 554) = 99
csy( 555) = 97
csy( 556) = 95
csy( 557) = 92
csy( 558) = 90
csy( 559) = 88
csy( 560) = 86
csy( 561) = 84
csy( 562) = 82
csy( 563) = 80
csy( 564) = 78
csy( 565) = 76
csy( 566) = 74
csy( 567) = 72
csy( 568) = 70
csy( 569) = 68
csy( 570) = 66
csy( 571) = 64
csy( 572) = 62
csy( 573) = 60
csy( 574) = 58
csy( 575) = 56
csy( 576) = 55
csy( 577) = 53
csy( 578) = 51
csy( 579) = 49
csy( 580) = 48
csy( 581) = 46
csy( 582) = 44
csy( 583) = 43
csy( 584) = 41
csy( 585) = 39
csy( 586) = 38
csy( 587) = 36
csy( 588) = 35
csy( 589) = 33
csy( 590) = 32
csy( 591) = 30
csy( 592) = 29
csy( 593) = 27
csy( 594) = 26
csy( 595) = 25
csy( 596) = 23
csy( 597) = 22
csy( 598) = 21
csy( 599) = 20
csy( 600) = 19
csy( 601) = 18
csy( 602) = 16
csy( 603) = 15
csy( 604) = 14
csy( 605) = 13
csy( 606) = 12
csy( 607) = 11
csy( 608) = 11
csy( 609) = 10
csy( 610) = 9
csy( 611) = 8
csy( 612) = 7
csy( 613) = 7
csy( 614) = 6
csy( 615) = 5
csy( 616) = 5
csy( 617) = 4
csy( 618) = 4
csy( 619) = 3
csy( 620) = 3
csy( 621) = 2
csy( 622) = 2
csy( 623) = 2
csy( 624) = 1
csy( 625) = 1
csy( 626) = 1
csy( 627) = 1
csy( 628) = 1
csy( 629) = 1
csy( 630) = 1
csy( 631) = 1
csy( 632) = 1
csy( 633) = 1
csy( 634) = 1
csy( 635) = 1
csy( 636) = 1
csy( 637) = 1
csy( 638) = 1
csy( 639) = 2
csy( 640) = 2
csy( 641) = 2
csy( 642) = 3
csy( 643) = 3
csy( 644) = 4
csy( 645) = 4
csy( 646) = 5
csy( 647) = 5
csy( 648) = 6
csy( 649) = 7
csy( 650) = 7
csy( 651) = 8
csy( 652) = 9
csy( 653) = 10
csy( 654) = 11
csy( 655) = 11
csy( 656) = 12
csy( 657) = 13
csy( 658) = 14
csy( 659) = 15
csy( 660) = 16
csy( 661) = 18
csy( 662) = 19
csy( 663) = 20
csy( 664) = 21
csy( 665) = 22
csy( 666) = 23
csy( 667) = 25
csy( 668) = 26
csy( 669) = 27
csy( 670) = 29
csy( 671) = 30
csy( 672) = 32
csy( 673) = 33
csy( 674) = 35
csy( 675) = 36
csy( 676) = 38
csy( 677) = 39
csy( 678) = 41
csy( 679) = 43
csy( 680) = 44
csy( 681) = 46
csy( 682) = 48
csy( 683) = 49
csy( 684) = 51
csy( 685) = 53
csy( 686) = 55
csy( 687) = 56
csy( 688) = 58
csy( 689) = 60
csy( 690) = 62
csy( 691) = 64
csy( 692) = 66
csy( 693) = 68
csy( 694) = 70
csy( 695) = 72
csy( 696) = 74
csy( 697) = 76
csy( 698) = 78
csy( 699) = 80
csy( 700) = 82
csy( 701) = 84
csy( 702) = 86
csy( 703) = 88
csy( 704) = 90
csy( 705) = 92
csy( 706) = 95
csy( 707) = 97
csy( 708) = 99
csy( 709) = 101
csy( 710) = 103
csy( 711) = 105
csy( 712) = 108
csy( 713) = 110
csy( 714) = 112
csy( 715) = 114
csy( 716) = 116
csy( 717) = 119
csy( 718) = 121
csy( 719) = 123
csy( 720) = 125
csy( 721) = 127






Portb.1 = 0
Portb.2 = 0


Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Up , Prescale = 1
'Compare1a Portb1
'Compare1b Portb2

Do

For X = 1 To 361 Step 8

Compare1a = Csy(x)
Compare1b = Csy(x + 180)



Next X

Loop
[/code]