próbanyákon összedugdostam egy atmega 8-at 2*16-os lcd-vel és encoderrel.
Működik, de most alap dolgot néznék, hőmérsékletet. Van egy ilyen hőmérőm.
Bascom alá hol találok demo progit ami kiköpi az lcd-re a hőmérsékletet?
Jelenlegi progi:
Kód: Egész kijelölése
$regfile = "m8def.dat"
$crystal = 8000000
$baud = 9600
$hwstack = 64
$swstack = 20
$framesize = 80
Config Portd.6 = Output
Led Alias Portd.6
Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portb.7 , Db6 = Portc.4 , Db7 = Portc.5 , Rs = Portc.1 , E = Portc.0
Config Lcd = 16 * 2
Config Lcdmode = Port
Initlcd
Cls
Cursor Off Noblink
Portd.3 = 1
Portd.2 = 1
Config Int0 = Falling
Config Int1 = Falling
Dim Wtime As Byte
Dim Encounter As Integer
Const Debouncetime = 1
On Int0 Encodera
On Int1 Encoderb
Wtime = 100
Encounter = 0
Enable Interrupts
Enable Int0
Enable Int1
Do
Set Led
Waitms Wtime
Upperline
Lcd "Enkoder: " ; Encounter ; " "
Reset Led
Waitms Wtime
Loop
Encodera:
Waitms Debouncetime
Incr Encounter
Gifr = 64
Return
Encoderb:
Waitms Debouncetime
Decr Encounter
Gifr = 128
Return
End