Skip to content

Commit

Permalink
More stable sensors readings
Browse files Browse the repository at this point in the history
  • Loading branch information
Peque committed Sep 13, 2018
1 parent 7807221 commit fc7001f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/target/detection.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,14 @@ static void update_raw_readings(void)
{
uint8_t i = 0;

inject_readings();
for (i = 0; i < NUM_SENSOR; i++)
for (i = 0; i < NUM_SENSOR; i++) {
inject_readings();
sensors_off[i] = adc_read_injected(ADC1, (i + 1));
}
for (i = 0; i < NUM_SENSOR; i++) {
inject_readings();
sensors_off[i] = adc_read_injected(ADC1, (i + 1));
}

for (i = 0; i < NUM_SENSOR; i++) {
set_emitter_on(i);
Expand Down

0 comments on commit fc7001f

Please sign in to comment.