Die Lötstelle sehen ganz gut aus.
Hier mal der Code von dem Programm das ich benutzt habe für die Auswertung:
Könnte ein fehlerhafter Widerstand die Ursache für das Problem sein? Wie kann ich das dann überprüfen?Code:/*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * any later version. * ***************************************************************************/ #include <stdlib.h> #include "asuro.h" uint16_t MyPollSwitch(void) { uint16_t i; DDRD |= SWITCHES; // Port-Bit SWITCHES als Output SWITCH_ON; // Port-Bit auf HIGH zur Messung ADMUX = (1 << REFS0) | SWITCH; // AVCC reference with external capacitor Sleep (10); ADCSRA |= (1 << ADSC); // Starte AD-Wandlung while (!(ADCSRA & (1 << ADIF))) // Ende der AD-Wandlung abwarten ; ADCSRA |= (1 << ADIF); // AD-Interupt-Flag zuruecksetzen i = ADCL + (ADCH << 8); // Ergebnis als 16-Bit-Wert SWITCH_OFF; // Port-Bit auf LOW Sleep (5); return ADC; } void SwitchTest(void) { uint8_t i, j, mval; uint16_t adval; for(i=0; i<6; i++) { SerPrint("\r\nPress Key "); PrintInt(6-i); SerPrint("\r\n"); Msleep(1500); adval = MyPollSwitch(); PrintInt(adval); Msleep(1500); adval = MyPollSwitch(); PrintInt(adval); Msleep(1500); adval = MyPollSwitch(); PrintInt(adval); Msleep(1500); adval = MyPollSwitch(); PrintInt(adval); Msleep(1500); } } int main(void) { Init(); SerPrint("\r\nTastsensor Kalibration\r\n"); while (1) { SwitchTest(); } }







Zitieren

Lesezeichen