Skip to content

Commit

Permalink
extended readme and minor style ficex
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKietzmann committed Mar 5, 2015
1 parent d37e78b commit c939182
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 0 additions & 3 deletions cpu/samd21/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ int adc_configure_with_resolution(Adc* adc, uint32_t precision)
/* Set Voltage Reference */
adc->REFCTRL.reg = (ADC_0_REF_COM_EN << ADC_REFCTRL_REFCOMP_Pos) | ADC_0_REF_DEFAULT;

int test = adc->REFCTRL.reg;
printf("\nREFCTRL %i\n", test);

switch (precision)
{
case ADC_0_RES_8BIT:
Expand Down
10 changes: 9 additions & 1 deletion tests/plant_node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ This test uses timers. Be aware that RIOT timers in the current master may crach

You need to change the standard output device from `UART_0` to `UART_1` to free the external ADC reference voltage pin. Then you need to connect an external tty/USB converter to see outputs on your terminal (i.e. pyterm).

When using the samr21-xpro you need the ADC mode with external reference pin. When this is enabled in the periph.conf.h you need to connect the 3V3 pin with the V_ref pin (on samr21-xpro PA04).
When using the samr21-xpro you need the ADC mode with external reference pin. When this is enabled in the periph.conf.h you need to connect the 3V3 pin with the V_ref pin (on samr21-xpro PA04).

# Needed pins summary

- GPIO Power pin - GPIO_0 - PA13
- ADC input pin - ADC_0_POS_INPUT - PA06
- ADC ref. pin - ADC_0_REF_DEFAULT - PA04
- Serial out - UART_1_TX_PIN - PA22
- Serial int - UART_1_RX_PIN - PA23
4 changes: 2 additions & 2 deletions tests/plant_node/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(void)
puts("\nRIOT test for a moisture sensor\n");

timex_t sleep1 = timex_set(1, 0); /* 1 sec. */
timex_t sleep2 = timex_set(1, 0); /* 10 sec. */
timex_t sleep2 = timex_set(1, 0); /* 1 sec. */

/* initialize a GPIO that powers the sensor just during a measure */
printf("Initializing GPIO_%i as power supplying pin", GPIO_POWER_PIN);
Expand Down Expand Up @@ -91,7 +91,7 @@ int main(void)
puts("Soil is dry");
}

/* wait for next measure */
/* wait for next measure */
vtimer_sleep(sleep2);
}

Expand Down

0 comments on commit c939182

Please sign in to comment.