From 7b1287afaf92e0971d9d693baed2f1524aed4569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Tue, 6 Jan 2015 17:52:22 +0100 Subject: [PATCH] add timer 1 measurement --- firmware/main.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index e1d4df8..1af7e2e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -31,6 +31,10 @@ /* variables */ volatile uint8_t state_portD; // the state of port D +volatile bool scale_on = false; // is the scale on (based on the SCALE_ON PIN) +volatile bool pwm_high = false; // is the PWM for the last weight measurement high +volatile bool measurement_flag = false; // is a PWM measurement value ready +volatile uint16_t measurement_value = 0; // the PWM measurement value from the timer /* switch off LED */ void led_off(void) @@ -57,8 +61,10 @@ ISR(PCINT2_vect) { if ((state_portD&(1<