- Timestamp:
- Oct 15, 2019, 7:05:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/libraries/Adafruit_Circuit_Playground/Adafruit_CircuitPlayground.cpp
r20 r30 40 40 pinMode(CPLAY_REDLED, OUTPUT); 41 41 pinMode(CPLAY_BUZZER, OUTPUT); 42 #if def __AVR__42 #if defined(__AVR__) 43 43 pinMode(CPLAY_CAPSENSE_SHARED, OUTPUT); 44 44 pinMode(CPLAY_LEFTBUTTON, INPUT); 45 45 pinMode(CPLAY_RIGHTBUTTON, INPUT); 46 46 pinMode(CPLAY_SLIDESWITCHPIN, INPUT); 47 #else // Circuit Playground Express 47 #elif defined(ARDUINO_NRF52840_CIRCUITPLAY) // bluefruit 48 pinMode(CPLAY_LEFTBUTTON, INPUT_PULLDOWN); 49 pinMode(CPLAY_RIGHTBUTTON, INPUT_PULLDOWN); 50 pinMode(CPLAY_SLIDESWITCHPIN, INPUT_PULLUP); 51 pinMode(CPLAY_SPEAKER_SHUTDOWN, OUTPUT); 52 digitalWrite(CPLAY_SPEAKER_SHUTDOWN, HIGH); 53 #elif defined(__SAMD21__) // Circuit Playground Express 48 54 pinMode(CPLAY_LEFTBUTTON, INPUT_PULLDOWN); 49 55 pinMode(CPLAY_RIGHTBUTTON, INPUT_PULLDOWN); … … 69 75 strip.setBrightness(brightness); 70 76 71 #if def __AVR__77 #if defined(__AVR__) || defined(ARDUINO_NRF52840_CIRCUITPLAY) // bluefruit 72 78 cap[0] = CPlay_CapacitiveSensor(CPLAY_CAPSENSE_SHARED, 0); 73 79 cap[1] = CPlay_CapacitiveSensor(CPLAY_CAPSENSE_SHARED, 1); … … 78 84 cap[6] = CPlay_CapacitiveSensor(CPLAY_CAPSENSE_SHARED, 10); 79 85 cap[7] = CPlay_CapacitiveSensor(CPLAY_CAPSENSE_SHARED, 12); 80 #el se // Circuit Playground Express// Circuit Playground Express86 #elif defined(__SAMD21__) // Circuit Playground Express 81 87 for(int i=0; i<7; i++) { 82 88 cap[i] = Adafruit_CPlay_FreeTouch(A1+i, OVERSAMPLE_4, RESISTOR_50K, FREQ_MODE_NONE); … … 97 103 /**************************************************************************/ 98 104 uint16_t Adafruit_CircuitPlayground::readCap(uint8_t p, uint8_t samples) { 99 #if def __AVR__ // Circuit Playground Classic105 #if defined(__AVR__) || defined(ARDUINO_NRF52840_CIRCUITPLAY) // Circuit Playground Classic or bluefruit 100 106 switch (p) { 101 107 case 0: return cap[0].capacitiveSensor(samples); … … 109 115 default: return 0; 110 116 } 111 #el se // Circuit Playground Express// Circuit Playground Express117 #elif defined(__SAMD21__) // Circuit Playground Express 112 118 // analog pins r ez! 113 119 if ((p >= A1) && (p <= A7)) {
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/Paradigma/chrome/site/paradigma.png)