Hier ist mein Arbeitsblatt:
Die Schaltung vom Florian Wolling ist Gold wert!
Und hier der Bascom Code, wenn an Porta.0 angeschlossen (beim Atmega 32):
Code:$regfile = "m32def.dat" $framesize = 32 $swstack = 256 $hwstack = 128 $crystal = 16000000 $baud = 9600 Dim I As Integer Config Adc = Single , Prescaler = Auto , Reference = Avcc Dim Volt As Single Dim Ws As Word Const Ref = 5 / 1023 Config Pina.0 = Input Do Start Adc Ws = Getadc(0) Volt = Ws * Ref Print Volt ; " Volt" Waitms 50 Loop End
Lesezeichen