diff --git a/lambda-test/lambda-test.c b/lambda-test/lambda-test.c index b7dfc35..4aefc00 100644 --- a/lambda-test/lambda-test.c +++ b/lambda-test/lambda-test.c @@ -41,7 +41,7 @@ bool testSetupPorts(void) { setupPorts(); - // test that pull-up resistor for the mouton is enabled + // test that the pull-up resistor for the mouton is enabled assertTrue(bit_is_set(PORTB, PB0)); return true; diff --git a/lambda/interrupts.c b/lambda/interrupts.c index a182ce1..c45d7ac 100644 --- a/lambda/interrupts.c +++ b/lambda/interrupts.c @@ -11,6 +11,7 @@ void setupPorts(void) { // pull-up resistor for the mouton + // INT0 and INT1 are assigned to the LCD, a bit of a shame PORTB |= (1 << PB0); // PB1 as output diff --git a/lambda/lcdroutines.h b/lambda/lcdroutines.h index 18b29be..e362a56 100644 --- a/lambda/lcdroutines.h +++ b/lambda/lcdroutines.h @@ -18,12 +18,12 @@ #define LCD_PORT PORTD #define LCD_DDR DDRD -#define LCD_RS PD6 -#define LCD_EN PD7 -#define LCD_DB4 PD5 -#define LCD_DB5 PD2 -#define LCD_DB6 PD3 -#define LCD_DB7 PD4 +#define LCD_RS PD6 // PD7 on diagram +#define LCD_EN PD7 // PD6 on diagram +#define LCD_DB4 PD5 // PD5 on diagram +#define LCD_DB5 PD2 // PD4 on diagram +#define LCD_DB6 PD3 // PD3 on diagram +#define LCD_DB7 PD4 // PD2 on diagram //////////////////////////////////////////////////////////////////////////////// // LCD Ausführungszeiten (MS=Millisekunden, US=Mikrosekunden) diff --git a/lambda/sensors.c b/lambda/sensors.c index 15554ff..ae0038d 100644 --- a/lambda/sensors.c +++ b/lambda/sensors.c @@ -57,7 +57,7 @@ }; /** - * Global variables holding averaged voltages. + * Variables holding averaged voltages. */ uint32_t lambdaVoltageAvg = 44 << 3; // Lambda 2.00 uint32_t tempIVoltageAvg = 100 << 3; // 20°C @@ -68,15 +68,15 @@ * calculates an exponential moving average and displays the translated values. */ measurement measure(void) { - uint32_t tempIVoltage = getVoltage(PC5); + uint32_t tempIVoltage = getVoltage(ADC_TEMPI); tempIVoltageAvg = tempIVoltage + tempIVoltageAvg - ((tempIVoltageAvg - 4) >> 3); - uint32_t tempOVoltage = getVoltage(PC0); + uint32_t tempOVoltage = getVoltage(ADC_TEMPO); tempOVoltageAvg = tempOVoltage + tempOVoltageAvg - ((tempOVoltageAvg - 4) >> 3); - uint32_t lambdaVoltage = getVoltage(PC2); + uint32_t lambdaVoltage = getVoltage(ADC_LAMBDA); lambdaVoltageAvg = lambdaVoltage + lambdaVoltageAvg - ((lambdaVoltageAvg - 4) >> 3); diff --git a/lambda/sensors.h b/lambda/sensors.h index fa53989..52a9b83 100644 --- a/lambda/sensors.h +++ b/lambda/sensors.h @@ -18,6 +18,10 @@ #define IDEAL "Ideal" #define RICH "Fett!" +#define ADC_TEMPI PC5 // PC5 on diagram +#define ADC_TEMPO PC0 // PC4 on diagram +#define ADC_LAMBDA PC2 // PC3 on diagram + /** * Entry for the lookup tables. */