Hi ich habe den Sensors "ein Sharp GP2D12" an den ADC PORTA.0 angeschlossen und trotzdem bekomme ich keine LED zum leuchten wo liegt der fehler bitte um hilfe...
Code:$regfile = "m32def.dat" $crystal = 16000000 Config Porta = Input Config Portc = Output Dim A As Word Enable Interrupts Start Adc Do A = Getadc(0) If a > 0 Then Portc.7 = 1 Else Portc.7 = 0 If a > 128 Then Portc.6 = 1 Else Portc.6 = 0 If a > 256 Then Portc.5 = 1 Else Portc.5 = 0 If a > 384 Then Portc.4 = 1 Else Portc.4 = 0 If a > 512 Then Portc.3 = 1 Else Portc.3 = 0 If a > 640 Then Portc.2 = 1 Else Portc.2 = 0 If a > 768 Then Portc.1 = 1 Else Portc.1 = 0 If a > 896 Then Portc.0 = 1 Else Portc.0 = 0 Waitms 10 Loop End
Lesezeichen