$regfile = "M8515.DAT" $crystal = 16000000 $baud = 9600 Config Pinb.0 = Output Config Pinb.1 = Output Config Pinb.2 = Output Config Pinb.3 = Output Config Pinb.4 = Output Config Pinb.5 = Output Config Pinb.6 = Output Config Porta = Output Config Pind.7 = Input Config Pind.2 = Input Config Pinc.0 = Input 'taster 1 Config Pinc.1 = Input 'taster 2 Config Pinc.2 = Input 'taster 3 Config Pinc.3 = Input 'taster 4 Config Pinc.4 = Output 'pwm out leds Config Pinc.5 = Output 'pwm out leds Config Pinc.6 = Output 'pwm out leds 'schieberegister Config Pind.5 = Output '3 strobe Config Pind.6 = Output '4 data Config Pind.7 = Output '5 clock 'isd Config Pinb.7 = Output '6 powerdown Config Pinc.7 = Output '7 chip enable _ Config Pine.2 = Output '8 play / rec _ Config Pine.1 = Input '9 end of memory _ Config Pine.0 = Input '10 overflow _ Set Portc.7 ' chip enable ist aktiv low Set Porte.2 Set Portb.7 Waitms 50 Reset Portb.7 Dim Sregdata As Word Dim Spkrenable As Byte Config Scl = Portd.3 Config Sda = Portd.4 I2cinit Dim Lm75high As Byte Dim Lm75low As Byte Dim Lm75sign As Byte Dim Segctr As Byte Dim Seg1 As Byte Dim Seg2 As Byte Dim Seg3 As Byte Dim Seg4 As Byte Dim Seg5 As Byte Dim Seg6 As Byte Dim Seg7 As Byte Dim Seg8 As Byte Dim Seg9 As Byte Dim Wday As Byte Dim Rot As Byte Dim Gruen As Byte Dim Blau As Byte Dim Rotr As Byte Dim Gruenr As Byte Dim Blaur As Byte Dim Pwmctr As Byte Dim Lfx As Byte Dim Fxan As Byte Dim Segdat As Byte Dim Segbin As Byte Dim Segout As Byte Dim Segi As Byte Dim Sego As Byte Dim Woche1 As Byte Dim Woche2 As Byte Dim Doppelpunkt As Byte Dim Check As Byte Dim Check2 As Byte Dim Check3 As Byte Dim Ende As Byte Dim Ta1 As Byte Dim Ta1g As Byte Dim Ta1c As Byte Dim Ta2 As Byte Dim Ta2g As Byte Dim Ta2c As Byte Dim Ta3 As Byte Dim Ta3g As Byte Dim Ta3c As Byte Dim Ta4 As Byte Dim Ta4g As Byte Dim Ta4c As Byte Dim S As Byte Dim M As Byte Dim H As Byte Dim D As Byte Dim Month As Byte Dim Wm As Byte Dim Yd As Byte Dim Sneu As Byte Dim Mneu As Byte Dim Hneu As Byte Dim Dneu As Byte Dim Almnr As Byte Dim Almnr2 As Byte Dim Blinken As Byte Dim Blinken2 As Byte Dim Setc As Byte Dim Serinp As Byte Dim Temp As Byte Dim Temp2 As Integer Dim Speechctr As Byte Dim Speechactive As Byte Dim Speech1 As Word Dim Speech2 As Word Dim Speech3 As Word Dim Speech4 As Word Dim Speech5 As Word Dim Speech6 As Word Dim Menue As Byte Dim Alarm As Byte Dim Altmph As Byte Dim Altmpm As Byte Dim Altmpmm As Byte Dim Alarmh1 As Byte Dim Alarmm1 As Byte Dim Alarmh2 As Byte Dim Alarmm2 As Byte Dim Almnre As Eram Byte At &H101 Dim Alarmh1e As Eram Byte At &H102 Dim Alarmm1e As Eram Byte At &H103 Dim Alarmh2e As Eram Byte At &H104 Dim Alarmm2e As Eram Byte At &H105 Dim Wsound As Byte Dim Wsounde As Eram Byte At &H100 Doppelpunkt = 1 Woche1 = 1 Woche2 = 1 Config Timer0 = Timer , Prescale = 8 On Ovf0 Vfd_int Enable Ovf0 Enable Interrupts Seg1 = 255 Seg2 = 255 Seg3 = 245 Seg4 = 148 Seg5 = 245 Seg6 = 139 Seg7 = 255 Seg8 = 255 Seg9 = 255 Reset Spkrenable Gosub Schieberegister Ende = 0 Gosub Readrtc Check = S Do Gosub Readrtc Check2 = S If Check = Check2 Then nop Else Ende = 2 End If Waitms 100 Incr Check3 If Check3 = 20 Then Ende = 1 Loop Until Ende > 0 Check = H If Check >= 24 Then Ende = 1 If Ende = 1 Then S = 0 M = 0 H = 0 D = 1 Month = 0 Gosub Setrtc End If Print "VFD Clock 1.0 - www.MALTEPOEGGEL.de -" Segi = 32 Do Serinp = Inkey() If Serinp = Asc( "t") Then Goto Testmode Gosub Wani Waitms 50 Decr Segi Print "."; Loop Until Segi = 0 Doppelpunkt = 0 Seg1 = 255 Seg2 = 255 Seg3 = 144 Seg4 = 144 Seg5 = 144 Seg6 = 144 Seg7 = 144 Seg8 = 144 Seg9 = 255 Gosub Initlm75 If Wsounde > 9 Then Wsounde = 0 Wsound = Wsounde Almnr = Almnre Gosub Holeep Do Gosub Readrtc Gosub Readlm75 Gosub Lichtfx Gosub Speechfx Gosub Alarmcheck Gosub Blinken If Menue <= 4 Then Select Case Alarm Case 0: Gosub Menuetasten Case 1: Gosub Alarmtasten Case 2: Gosub Alarmtasten Case 3: Gosub Alarmtasten Case 4: Gosub Menuetasten End Select End If Select Case Menue Case 0: Gosub Tout Case 1: Gosub Gout Case 2: Gosub Tset Case 3: Gosub Aset Case 4: Gosub Sset Case 5: Gosub Tset2 Case 6: Gosub Aset2 Case 7: Gosub Sset2 End Select Loop Vfd_int: Incr Segctr If Segctr = 10 Then Segctr = 0 Porta = 255 Portb = Segctr Portb.6 = Woche1 Portb.5 = Woche2 Portb.4 = Doppelpunkt Select Case Segctr Case 1: Porta = Seg1 Case 2: Porta = Seg2 Case 3: If Wday = 7 Then Porta = Seg3 -128 Else Porta = Seg3 Case 4: If Wday = 1 Then Porta = Seg4 -128 Else Porta = Seg4 Case 5: If Wday = 2 Then Porta = Seg5 -128 Else Porta = Seg5 Case 6: If Wday = 3 Then Porta = Seg6 -128 Else Porta = Seg6 Case 7: If Wday = 4 Then Porta = Seg7 -128 Else Porta = Seg7 Case 8: If Wday = 5 Then Porta = Seg8 -128 Else Porta = Seg8 Case 9: If Wday = 6 Then Porta = Seg9 -128 Else Porta = Seg9 End Select Incr Pwmctr If Pwmctr >= 128 Then Pwmctr = 0 If Pwmctr < Rot Then Set Portc.4 Else Reset Portc.4 If Pwmctr < Gruen Then Set Portc.5 Else Reset Portc.5 If Pwmctr < Blau Then Set Portc.6 Else Reset Portc.6 If Pine.1 = 0 Then Speechactive = 0 If Pinc.0 = 0 Then Set Ta1g If Ta1c = 0 Then Set Ta1 Ta1c = 255 End If Else Reset Ta1g If Ta1c > 0 Then Decr Ta1c End If If Pinc.1 = 0 Then Set Ta2g If Ta2c = 0 Then Set Ta2 Ta2c = 255 End If Else Reset Ta2g If Ta2c > 0 Then Decr Ta2c End If If Pinc.2 = 0 Then Set Ta3g If Ta3c = 0 Then Set Ta3 Ta3c = 255 End If Else Reset Ta3g If Ta3c > 0 Then Decr Ta3c End If If Pinc.3 = 0 Then Set Ta4g If Ta4c = 0 Then Set Ta4 Ta4c = 255 End If Else Reset Ta4g If Ta4c > 0 Then Decr Ta4c End If Return Konvertieren: Select Case Segi Case 0: Sego = 144 Case 1: Sego = 245 Case 2: Sego = 200 Case 3: Sego = 224 Case 4: Sego = 165 Case 5: Sego = 162 Case 6: Sego = 130 Case 7: Sego = 244 Case 8: Sego = 128 Case 9: Sego = 160 End Select Return Readrtc: I2cstart 'generate start I2cwbyte &HA2 'write addres of PCF8583 I2cwbyte 2 'select second register I2cstart 'generate repeated start I2cwbyte &HA3 'write address for reading info I2crbyte S , Ack 'read seconds I2crbyte M , Ack 'read minuts I2crbyte H , Ack 'read hours I2crbyte Yd , Ack 'read year and days I2crbyte Wm , Nack 'read weekday and month I2cstop 'generate stop S = Makedec(s) M = Makedec(m) H = Makedec(h) Return Setrtc: S = Makebcd(s) 'seconds M = Makebcd(m) 'minuts H = Makebcd(h) 'hours I2cstart 'generate start I2cwbyte &HA2 'write address I2cwbyte 0 'select control register I2cwbyte &B00000000 'dont mask year and day bit I2cstop 'generate stop I2cstart 'generate start I2cwbyte &HA2 'write mode I2cwbyte 2 'select seconds Register I2cwbyte S 'write seconds I2cwbyte M 'write minuts I2cwbyte H 'write hours I2cwbyte D 'write days I2cwbyte Month 'write months I2cstop Return Tout: Seg1 = 255 Seg2 = 255 Seg9 = 255 Doppelpunkt = 0 Segdat = S Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren Seg7 = Sego Segi = Segdat Gosub Konvertieren Seg8 = Sego Segdat = M Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren Seg5 = Sego Segi = Segdat Gosub Konvertieren Seg6 = Sego Segdat = H Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren Seg3 = Sego Segi = Segdat Gosub Konvertieren Seg4 = Sego Sego = 0 If Wm.5 = 1 Then Sego = 1 If Wm.6 = 1 Then Sego = Sego + 2 If Wm.7 = 1 Then Sego = Sego + 4 Incr Sego Wday = Sego If Ta2 = 1 Then Reset Ta2 If Speechctr = 0 Then Gosub Sagezeit End If If Ta1 = 1 Then Reset Ta1 Gosub Togglealm End If Almnr2 = Almnr Gosub Zeigealm Return Lichtfx: If Fxan = 1 Then If Lfx = 0 Then Rot = 0 Gruen = 64 Blau = 128 Blaur = 1 Lfx = 1 End If If Rotr = 0 Then Incr Rot Else Decr Rot If Gruenr = 0 Then Incr Gruen Else Decr Gruen If Blaur = 0 Then Incr Blau Else Decr Blau If Rot = 128 Then Rotr = 1 If Gruen = 128 Then Gruenr = 1 If Blau = 128 Then Blaur = 1 If Rot = 0 Then Rotr = 0 If Blau = 0 Then Blaur = 0 If Gruen = 0 Then Gruenr = 0 Waitms 5 Else Lfx = 0 Rot = 0 Gruen = 0 Blau = 0 Rotr = 0 Gruenr = 0 Blaur = 0 End If Return Schieberegister: Portd.6 = Spkrenable Gosub Schieberegister_data Portd.6 = Sregdata.14 Gosub Schieberegister_data Portd.6 = Sregdata.13 Gosub Schieberegister_data Portd.6 = Sregdata.12 Gosub Schieberegister_data Portd.6 = Sregdata.11 Gosub Schieberegister_data Portd.6 = Sregdata.10 Gosub Schieberegister_data Portd.6 = Sregdata.9 Gosub Schieberegister_data Portd.6 = Sregdata.8 Gosub Schieberegister_data Portd.6 = Sregdata.7 Gosub Schieberegister_data Portd.6 = Sregdata.6 Gosub Schieberegister_data Portd.6 = Sregdata.5 Gosub Schieberegister_data Portd.6 = Sregdata.4 Gosub Schieberegister_data Portd.6 = Sregdata.3 Gosub Schieberegister_data Portd.6 = Sregdata.2 Gosub Schieberegister_data Portd.6 = Sregdata.1 Gosub Schieberegister_data Portd.6 = Sregdata.0 Gosub Schieberegister_data Gosub Schieberegister_strobe Return Schieberegister_data: Set Portd.5 Reset Portd.5 Return Schieberegister_strobe: Set Portd.7 Reset Portd.7 Return Isdplay: Set Porte.2 Return Isdrec: Reset Porte.2 Return Isdstart: Reset Portc.7 Return Isdstop: Set Portc.7 Return Isdreset: Set Portb.7 Waitms 50 Reset Portb.7 Return Testmode: '## aufnahme routine Print "TMod" Temp2 = 0 Gosub Isdreset Gosub Isdrec Sregdata = 0 Do Do Serinp = Inkey() Loop Until Serinp = Asc( "a") Incr Sregdata Print "A" Writeeeprom Sregdata , Temp2 Gosub Schieberegister Waitms 25 Gosub Isdstart Do Serinp = Inkey() Incr Sregdata Waitms 100 Loop Until Serinp = Asc( "b") Gosub Isdstop Waitms 25 Print "E" Incr Temp2 Incr Temp2 Incr Sregdata Incr Sregdata Loop Speechfx: If Speechctr = 0 Then Return If Speechactive = 0 Then Select Case Speechctr Case 1: Incr Speechctr Set Spkrenable Sregdata = Speech1 Gosub Playit Case 2: Incr Speechctr Sregdata = Speech2 Gosub Playit Case 3: Incr Speechctr Sregdata = Speech3 Gosub Playit Case 4: Incr Speechctr Sregdata = Speech4 Gosub Playit Case 5: Incr Speechctr Sregdata = Speech5 Gosub Playit Case 6: Incr Speechctr Sregdata = Speech6 Gosub Playit Case 7: Speechctr = 0 Reset Spkrenable Sregdata = 0 Gosub Schieberegister End Select End If Return Playit: If Sregdata > 0 Then If Sregdata = 1 Then Decr Sregdata Gosub Schieberegister Waitms 25 Gosub Isdstart Waitms 2 Gosub Isdstop Speechactive = 1 End If Return Sagezeit: Speechctr = 1 Readeeprom Speech1 , 54 'es ist Segdat = H Segdat = Segdat * 2 Readeeprom Speech2 , Segdat ' stunden Readeeprom Speech3 , 56 'uhr Segdat = M If Segdat <= 23 Then If Segdat = 1 Then Segdat = 30 'Routine Zahlen kleiner oder gleich 23 Segdat = Segdat * 2 Readeeprom Speech6 , Segdat Speech4 = 0 Speech5 = 0 If Speech6 = 1 Then Speech6 = 0 Else 'Routine für Zahlen größer 23 Temp = 0 Do Incr Temp Incr Temp Segdat = Segdat - 10 Loop Until Segdat < 10 Segdat = Segdat * 2 If Segdat = 0 Then Speech4 = 0 Speech5 = 0 Else Readeeprom Speech4 , Segdat Readeeprom Speech5 , 58 End If If Temp = 4 Then Temp = 40 Else Temp = Temp + 42 Readeeprom Speech6 , Temp End If Return Menuetasten: If Ta3 = 1 Then Gosub Resettas Incr Menue If Menue > 4 Then Menue = 4 End If If Ta4 = 1 Then Gosub Resettas Decr Menue If Menue = 255 Then Menue = 0 End If Return Gout: Doppelpunkt = 1 Wday = 0 Woche1 = 1 Woche2 = 1 Gosub Readlm75 Seg2 = 255 Seg5 = 247 Seg7 = 172 Seg8 = 154 Seg9 = 255 Segdat = Lm75high If Lm75sign = 1 Then Seg1 = 127 Else Seg1 = 255 Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren Seg3 = Sego Segi = Segdat Gosub Konvertieren Seg4 = Sego Segi = Lm75low Gosub Konvertieren Seg6 = Sego Return Tset: Doppelpunkt = 1 Wday = 0 Woche1 = 1 Woche2 = 1 Seg1 = 255 Seg2 = 255 Seg3 = 139 Seg4 = 162 Seg5 = 138 Seg6 = 139 Seg7 = 255 Seg8 = 255 Seg9 = 255 If Ta1 = 1 Then Gosub Resettas Sneu = S Mneu = M Hneu = H Sego = 0 Segdat = Wm If Segdat.5 = 1 Then Sego = 1 If Segdat.6 = 1 Then Sego = Sego + 2 If Segdat.7 = 1 Then Sego = Sego + 4 Incr Sego Dneu = Sego Setc = 0 Menue = 5 End If Return Tset2: Doppelpunkt = 0 Woche1 = 1 Woche2 = 1 Seg1 = 255 Seg2 = 255 Seg9 = 255 Segdat = Sneu Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren If Blinken = 0 Then Seg7 = Sego Else If Setc = 2 Then Seg7 = 255 Else Seg7 = Sego Segi = Segdat Gosub Konvertieren If Blinken = 0 Then Seg8 = Sego Else If Setc = 2 Then Seg8 = 255 Else Seg8 = Sego Gosub Hmeinstellen If Blinken = 0 Then Wday = Dneu Else If Setc = 3 Then Wday = 0 Else Wday = Dneu If Ta1 = 1 Then Gosub Resettas S = Sneu M = Mneu H = Hneu Decr Dneu Rotate Dneu , Left , 5 Month = Dneu Gosub Setrtc Menue = 0 End If If Ta2 = 1 Then Reset Ta2 Incr Setc If Setc = 4 Then Setc = 0 End If Gosub Zeittasten Return Readlm75: I2cstart I2cwbyte &B10011110 I2cwbyte &B00000000 I2cstart I2cwbyte &B10011111 I2crbyte Lm75high , Ack I2crbyte Lm75low , Nack I2cstop Lm75sign = 0 If Lm75high > 127 Then Lm75high = Not Lm75high Incr Lm75high Lm75sign = 1 End If Lm75low = Lm75low And &B10000000 If Lm75low = &B10000000 Then Lm75low = 5 End If Return Initlm75: I2cstart I2cwbyte &B10011110 I2cwbyte &B00000001 I2cwbyte &B00000000 I2cstop Return Aset: Woche1 = 1 Woche2 = 1 Seg1 = 255 Seg2 = 255 Seg3 = 132 Seg4 = 162 Seg5 = 138 Seg6 = 139 Seg7 = 255 Seg8 = 255 Seg9 = 255 If Ta1 = 1 Then Gosub Resettas Menue = 6 End If Return Sset: Woche1 = 1 Woche2 = 1 Seg1 = 255 Seg2 = 255 Seg3 = 162 Seg4 = 162 Seg5 = 138 Seg6 = 139 Seg7 = 255 Seg8 = 255 Seg9 = 255 If Ta1 = 1 Then Gosub Resettas Menue = 7 Almnr = 1 End If Return Aset2: If Setc = 2 Then If Blinken = 0 Then Gosub Zeigealm Else Woche1 = 1 Woche2 = 1 End If Else Gosub Zeigealm End If Doppelpunkt = 0 Seg1 = 255 Seg2 = 255 Seg7 = 255 Seg8 = 255 Seg9 = 255 ''Setc Mneu Hneu Select Case Almnr2 Case 1: Mneu = Alarmm1 Hneu = Alarmh1 Gosub Zeittasten2 Alarmm1 = Mneu Alarmh1 = Hneu Case 2: Mneu = Alarmm2 Hneu = Alarmh2 Gosub Zeittasten2 Alarmm2 = Mneu Alarmh2 = Hneu End Select Gosub Hmeinstellen If Ta2 = 1 Then Reset Ta2 Incr Setc If Setc > 2 Then Setc = 0 End If If Ta1 = 1 Then Reset Ta1 Gosub Schreibeep Menue = 0 End If Return Zeittasten2: If Ta3 = 1 Then Reset Ta3 Select Case Setc Case 2: Almnr2 = 2 Case 1: Incr Mneu If Mneu = 60 Then Mneu = 0 Case 0: Incr Hneu If Hneu = 24 Then Hneu = 0 End Select End If If Ta4 = 1 Then Reset Ta4 Select Case Setc Case 2: Almnr2 = 1 Case 1: Decr Mneu If Mneu = 255 Then Mneu = 59 Case 0: Decr Hneu If Hneu = 255 Then Hneu = 23 End Select End If Return Sset2: Woche1 = 1 Woche2 = 1 Seg1 = 255 Seg2 = 255 Seg3 = 162 Seg4 = 162 Seg5 = 138 Seg6 = 139 Seg8 = 255 Seg9 = 255 Segi = Wsound Gosub Konvertieren If Blinken = 0 Then Seg7 = Sego Else Seg7 = 255 If Ta1 = 1 Then Reset Ta1 Wsounde = Wsound Menue = 0 End If If Ta2 = 1 Then Seg7 = Sego Reset Ta2 Segi = Segi + 30 Segi = Segi * 2 Readeeprom Sregdata , Segi Set Spkrenable Gosub Playit Temp = 0 Do Gosub Wani Waitms 50 Loop Until Speechactive = 0 Reset Spkrenable Gosub Schieberegister End If If Ta3 = 1 Then Reset Ta3 Incr Wsound If Wsound > 9 Then Wsound = 9 End If If Ta4 = 1 Then Reset Ta4 Decr Wsound If Wsound = 255 Then Wsound = 0 End If Return Wani: Select Case Temp Case 0: Seg1 = 254 Case 1: Seg1 = 253 Case 2: Seg1 = 247 Case 3: Seg1 = 251 Case 4: Seg1 = 223 Case 5: Seg1 = 191 End Select Incr Temp If Temp = 6 Then Temp = 0 Return Alarmtasten: If Ta1 = 1 Then Gosub Resettas Alarm = 3 End If If Ta2 = 1 Then Gosub Resettas Alarm = 3 End If If Ta3 = 1 Then Gosub Resettas Alarm = 3 End If If Ta4 = 1 Then Gosub Resettas Alarm = 3 End If Return Alarmcheck: Select Case Alarm Case 0: Fxan = 0 Case 2: If Speechactive = 0 Then If Speechctr = 0 Then Segi = Wsound + 30 Segi = Segi * 2 Readeeprom Sregdata , Segi Set Spkrenable Gosub Playit End If End If Case 1: Incr Alarm Fxan = 1 Gosub Sagezeit Case 3: Reset Spkrenable Gosub Schieberegister Incr Alarm Fxan = 0 End Select Altmph = H Altmpm = M Sego = 0 If Wm.5 = 1 Then Sego = 1 If Wm.6 = 1 Then Sego = Sego + 2 If Wm.7 = 1 Then Sego = Sego + 4 Incr Sego If Altmpmm = Altmpm Then Else Alarm = 0 If Altmph = Alarmh1 Then If Altmpm = Alarmm1 Then If Almnr = 1 Then Gosub Alarmstart End If End If If Altmph = Alarmh2 Then If Altmpm = Alarmm2 Then If Almnr = 2 Then Gosub Alarmstart End If End If Return Alarmstart: If Alarm = 0 Then Altmpmm = Altmpm Alarm = 1 End If Return Blinken: Incr Blinken2 If Blinken2 = 255 Then Toggle Blinken Return Resettas: Reset Ta1 Reset Ta2 Reset Ta3 Reset Ta4 Return Holeep: Alarmh1 = Alarmh1e Alarmm1 = Alarmm1e Alarmh2 = Alarmh2e Alarmm2 = Alarmm2e Return Schreibeep: Alarmh1e = Alarmh1 Alarmm1e = Alarmm1 Alarmh2e = Alarmh2 Alarmm2e = Alarmm2 Return Togglealm: Incr Almnr If Almnr > 2 Then Almnr = 0 Almnre = Almnr Return Zeigealm: Select Case Almnr2 Case 0: Woche1 = 1 Woche2 = 1 Case 1: Woche1 = 0 Woche2 = 1 Case 2: Woche1 = 1 Woche2 = 0 End Select Return Hmeinstellen: Segdat = Mneu Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren If Blinken = 0 Then Seg5 = Sego Else If Setc = 1 Then Seg5 = 255 Else Seg5 = Sego Segi = Segdat Gosub Konvertieren If Blinken = 0 Then Seg6 = Sego Else If Setc = 1 Then Seg6 = 255 Else Seg6 = Sego Segdat = Hneu Segbin = 0 While Segdat >= 10 Segdat = Segdat - 10 Incr Segbin Wend Segi = Segbin Gosub Konvertieren If Blinken = 0 Then Seg3 = Sego Else If Setc = 0 Then Seg3 = 255 Else Seg3 = Sego Segi = Segdat Gosub Konvertieren If Blinken = 0 Then Seg4 = Sego Else If Setc = 0 Then Seg4 = 255 Else Seg4 = Sego Return Zeittasten: If Ta3 = 1 Then Reset Ta3 Select Case Setc Case 3: Incr Dneu If Dneu = 8 Then Dneu = 1 Case 2: Incr Sneu If Sneu = 60 Then Sneu = 0 Case 1: Incr Mneu If Mneu = 60 Then Mneu = 0 Case 0: Incr Hneu If Hneu = 24 Then Hneu = 0 End Select End If If Ta4 = 1 Then Reset Ta4 Select Case Setc Case 3: Decr Dneu If Dneu = 0 Then Dneu = 7 Case 2: Decr Sneu If Sneu = 255 Then Sneu = 59 Case 1: Decr Mneu If Mneu = 255 Then Mneu = 59 Case 0: Decr Hneu If Hneu = 255 Then Hneu = 23 End Select End If Return Dta: $eeprom Data 1% , 8% , 15% , 23% , 31% , 39% , 48% , 56% , 65% , 73% , 82% , 90% , 98% , 107% , 117% , 127% , 138% , 149% , 160% , 170% , 180% , 191% , 205% , 219% , 233% , 244% , 254% , 265% , 274% , 282% $data End