Sfoglia il codice sorgente

Add internal analog channels on Teensy-LC

main
PaulStoffregen 9 anni fa
parent
commit
ea4252feb8
1 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  1. +4
    -5
      teensy3/analog.c

+ 4
- 5
teensy3/analog.c Vedi File

@@ -342,13 +342,10 @@ static const uint8_t channel2sc1a[] = {
#elif defined(__MKL26Z64__)
static const uint8_t channel2sc1a[] = {
5, 14, 8, 9, 13, 12, 6, 7, 15, 11,
0, 4+64, 23
0, 4+64, 23, 26, 27
};





#endif


@@ -396,6 +393,9 @@ int analogRead(uint8_t pin)
index = pin; // 0-12 refer to A0-A12
} else if (pin >= 14 && pin <= 26) {
index = pin - 14; // 14-26 are A0-A12
} else if (pin >= 38 && pin <= 39) {
index = pin - 25; // 38=temperature
// 39=bandgap ref (PMC_REGSC |= PMC_REGSC_BGBE)
} else {
return 0;
}
@@ -528,4 +528,3 @@ void analogWriteDAC0(int val)





Loading…
Annulla
Salva