Jak skonfigurować i jak odczytać wartość ADC w ATMega8 w Bascomie ?
I jak to wogóle działa
Pozdrawiam !
I jak to wogóle działa
Pozdrawiam !
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
$regfile = "m8def.dat"
$crystal = 11059200
$baud = 19200
Config Adc = Single , Prescaler = Auto , Reference = Off
Config Timer1 = Timer , Prescale = 256
On Timer1 Pomiar
Enable Interrupts
Enable Timer1
Timer1 = 65104
Start Adc
Dim W(2)as Word , Channel As Byte
Channel = 0
Do
Loop
Pomiar:
Timer1 = 65104
W(channel + 1) = Getadc(channel)
Incr Channel
W(channel + 1) = Getadc(channel)
If Channel > 1 Then Channel = 0
Print W(1) ; " " ; W(2)
Return