Skip to content

Commit

Permalink
Playing with the prescaler of the ADC.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBleijendaal committed Jul 27, 2016
1 parent 267f326 commit 2f5b868
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Arduino/Edt_Trak_v1/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ EthernetUDP Udp;

EdtAITrak Trak = EdtAITrak(0, 0, 0, 0, 0, 0, OSC_TRAK);

// Define various ADC prescaler
// http://www.microsmart.co.za/technical/2014/03/01/advanced-arduino-adc/
const unsigned char PS_16 = (1 << ADPS2);
const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);
const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);

void setup() {
// set up the ADC
ADCSRA &= ~PS_128;
ADCSRA |= PS_16;

Statemachine.begin(13, LOW);
}

Expand Down

0 comments on commit 2f5b868

Please sign in to comment.