so in etwa?
hab mir aus verschiedenen schnipseln mal was zusammengebaut
kann man das noch schöner machen?
Code:$regfile = "m32def.dat" $crystal = 1000000 $hwstack = 32 $swstack = 32 $framesize = 32 '$sim Config Lcd = 20 * 4 Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.2 , Rs = Portc.0 Declare Sub Zähler Cursor Of Noblink Cursor Off Cls 'Menüversuch Const Keys = 3 Config Portd = Input Portd = 255 Dim I As Byte Dim Key As Byte Dim Zählerstand As Single Do For I = 1 To Keys Key = I Select Case Key Case 1 : Debounce Pind.0 , 0 , Display_keyup , Sub Case 2 : Debounce Pind.1 , 0 , Display_keydown , Sub Case 3 : Debounce Pind.2 , 0 , Display_keyenter , Sub End Select Next Loop End Display_keyup: Locate 1 , 1 Lcd "Menue 1" Return Display_keydown: Locate 1 , 1 Lcd " Menue 2" Return Display_keyenter: Zählerstand = 150 Sub Zähler '######################################################################## Do 'Hauptschleife 'Abfrage der Tasten Debounce Pind.0 , 1 , Minus_ , Sub 'Zählerstand reduzieren Debounce Pind.1 , 1 , Plus_ , Sub 'Zählerstand erhöhen Debounce Pind.2 , 1 , Dezi_ , Sub 'mal 10 Debounce Pind.3 , 1 , Mezi_ , Sub 'durch 10 Loop '####################################################################### Plus_: Incr Zählerstand Locate 1 , 1 Lcd "Frequenz :" ; Zählerstand ; " Mhz" Return Minus_: Decr Zählerstand Locate 1 , 1 Lcd "Frequenz :" ; Zählerstand ; " Mhz" Return Dezi_: Zählerstand = Zählerstand * 10 Locate 1 , 1 Lcd "Frequenz :" ; Zählerstand ; " Mhz" Return Mezi_: Zählerstand = Zählerstand / 10 Locate 1 , 1 Lcd " Frequenz :" ; Zählerstand ; " Mhz" Return End Sub






Zitieren

Lesezeichen