Hallo erstmal
Ich hab folgendes Problem:
Ich will mir ein RGB Licht bauen und das über einen
Controller steuern.
Also hab ich das erstmal mit einem Atmega 8 gemacht weil der vorhanden
war![]()
Das hat dann auch perfekt funktioniert, alles hat schön durchgefadet wie es sein soll =D>
Doch dann dachte ich, dass ein Atmega 8 irgendwie Verschwendung wäre
und wollte einen Attiny 2313 nehmen, sollte ja angeblich aich genug Timer haben.
Also den Code vom Mega 8 umgeschrieben und versucht zu compillieren...
Geht nicht!
Irgendwie sagt mir Bascom beim Kompillieren
Line 44 Assignment error (OCR2: 0 Grun: 2)
Line 52 Assignment error (OCR2: 0 Grun: 2)
Line 52 LOOP expected
Und Das versteh ich überhaupt nicht![]()
Kann mir bitte jemand sagen was an dem Code Falsch ist ?
Hier ist der Code vom Atmega8 der geht:
Und hier der vom Attiny2313 der nicht geht :Code:$regfile = "m8def.dat" $crystal = 1000000 Config Portb.1 = Output Config Portb.2 = Output Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Up , Prescale = 1 Config Timer2 = Pwm , Prescale = 1 , Compare Pwm = Clear Up , Pwm = On Dim Rr As Byte Dim Gg As Byte Dim Bb As Byte Do Gosub Raufrot , Gosub Runtergrün Gosub Raufgrün , Gosub Runterblau Gosub Raufblau , Gosub Runterrot Loop End Raufblau: Do Compare1a = Rr Incr Rr Waitms 10 Loop Until Rr = 255 Return Runterblau: Do Compare1a = Rr Decr Rr Waitms 10 Loop Until Rr = 255 Return Raufgrün: Do Ocr2 = Gg Incr Gg Waitms 10 Loop Until Gg = 255 Return Runtergrün: Do Ocr2 = Gg Decr Gg Waitms 10 Loop Until Gg = 255 Return Raufrot: Do Compare1b = Bb Incr Bb Waitms 10 Loop Until Bb = 255 Return Runterrot: Do Compare1b = Bb Decr Bb Waitms 10 Loop Until Bb = 255 Return
Bitte, bitteCode:$regfile = "ATTiny2313.DAT" $crystal = 1000000 $hwstack = 64 $swstack = 16 $framesize = 21 Config Portb.2 = Output Config Portb.3 = Output Config Portb.4 = Output Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Up , Prescale = 1 Config Timer2 = Pwm , Prescale = 1 , Compare Pwm = Clear Up , Pwm = On Dim Rr As Byte Dim Grun As Byte Dim Bb As Byte Do Gosub Raufrot , Gosub Runtergrün Gosub Raufgrün , Gosub Runterblau Gosub Raufblau , Gosub Runterrot Loop End Raufblau: Do Compare1a = Rr Incr Rr Waitms 10 Loop Until Rr = 255 Return Runterblau: Do Compare1a = Rr Decr Rr Waitms 10 Loop Until Rr = 255 Return Raufgrün: Do Ocr2 = Grun Incr Grun Waitms 10 Loop Until Grun = 255 Return Runtergrün: Do Ocr2 = Grun Decr Grun Waitms 10 Loop Until Grun = 255 Return Raufrot: Do Compare1b = Bb Incr Bb Waitms 10 Loop Until Bb = 255 Return Runterrot: Do Compare1b = Bb Decr Bb Waitms 10 Loop Until Bb = 255 Return
falls jemand Rat weiss würde ich mich einen Keks freuen [-o<
mfg Patrick








Zitieren

Lesezeichen