Changeset 20 for trunk/Arduino/libraries/Adafruit_Circuit_Playground
- Timestamp:
- Sep 10, 2019, 11:25:01 AM (7 years ago)
- Location:
- trunk/Arduino/libraries/Adafruit_Circuit_Playground
- Files:
-
- 6 edited
-
Adafruit_CircuitPlayground.cpp (modified) (20 diffs)
-
README.md (modified) (1 diff)
-
library.properties (modified) (1 diff)
-
utility/Adafruit_CPlay_LIS3DH.h (modified) (1 diff)
-
utility/Adafruit_CPlay_NeoPixel.cpp (modified) (2 diffs)
-
utility/talkie.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Arduino/libraries/Adafruit_Circuit_Playground/Adafruit_CircuitPlayground.cpp
r3 r20 8 8 * This is the documentation for Adafruit's CircuitPlayground driver for the 9 9 * Arduino platform. It is designed specifically to work with the 10 * Adafruit CircuitPlayground boards: 10 * Adafruit CircuitPlayground boards: 11 11 * - https://www.adafruit.com/products/3000 12 12 * - https://www.adafruit.com/products/3333 … … 31 31 32 32 /**************************************************************************/ 33 /*! 33 /*! 34 34 @brief Set up the CircuitPlayground hardware 35 35 @param brightness Optional brightness to set the neopixels to … … 51 51 irReceiver=IRrecvPCI(CPLAY_IR_RECEIVER); 52 52 irDecoder=IRdecode(); 53 // since we aren't calling speaker.begin() anymore, do this here 54 pinMode(CPLAY_SPEAKER_SHUTDOWN, OUTPUT); 55 digitalWrite(CPLAY_SPEAKER_SHUTDOWN, HIGH); 53 56 #endif 54 57 … … 86 89 87 90 /**************************************************************************/ 88 /*! 91 /*! 89 92 @brief read capacitive touch sensor 90 93 @param p the pin to read. Must be a captouch enabled pin. … … 126 129 127 130 /**************************************************************************/ 128 /*! 131 /*! 129 132 @brief turn on or off the red LED on pin #13 130 133 @param v pass true to turn LED on, false to turn LED off … … 136 139 137 140 /**************************************************************************/ 138 /*! 141 /*! 139 142 @brief read the slide switch 140 143 @returns true if slide switch in set, false if not … … 146 149 147 150 /**************************************************************************/ 148 /*! 149 @brief read the left button 151 /*! 152 @brief read the left button 150 153 @returns true if button is pressed, false if not 151 154 */ … … 156 159 157 160 /**************************************************************************/ 158 /*! 161 /*! 159 162 @brief read the right button 160 163 @returns true if button is pressed, false if not … … 166 169 167 170 /**************************************************************************/ 168 /*! 171 /*! 169 172 @brief play a tone on the onboard buzzer 170 173 @param freq the frequency to play 171 174 @param time the duration of the tone in milliseconds 172 175 @param wait Optional flag to wait for time milliseconds after playing the tone. Defaults to true. 173 @note The driver circuitry is an on/off transistor driver, so you will only be able to play square waves. 176 @note The driver circuitry is an on/off transistor driver, so you will only be able to play square waves. 174 177 It is also not the same loudness over all frequencies but is designed to be the loudest at around 4 KHz 175 178 */ … … 208 211 lo2 = (ocr >> 1) & 0xFF; 209 212 noInterrupts(); // TC4H accesses MUST be atomic 210 TC4H = hi1; 213 TC4H = hi1; 211 214 OCR4C = lo1; // TOP 212 TC4H = hi2; 215 TC4H = hi2; 213 216 OCR4A = lo2; // 50% duty 214 217 interrupts(); … … 225 228 226 229 /**************************************************************************/ 227 /*! 230 /*! 228 231 @brief read the onboard lightsensor 229 232 @returns value between 0 and 1023 read from the light sensor 230 @note 1000 Lux will roughly read as 2 Volts (or about 680 as a raw analog reading). 231 A reading of about 300 is common for most indoor light levels. 232 Note that outdoor daylight is 10,000 Lux or even higher, so this sensor is best 233 @note 1000 Lux will roughly read as 2 Volts (or about 680 as a raw analog reading). 234 A reading of about 300 is common for most indoor light levels. 235 Note that outdoor daylight is 10,000 Lux or even higher, so this sensor is best 233 236 suited for indoor light levels! 234 237 */ … … 239 242 240 243 /**************************************************************************/ 241 /*! 244 /*! 242 245 @brief read the onboard sound sensor. A reading of ~0 is silent, and 243 246 loud audio will result in a reading between -500 and 500 or so. … … 252 255 253 256 /**************************************************************************/ 254 /*! 257 /*! 255 258 @brief read the X parameter of the onboard accelerometer. Value returned is 256 259 defined by setAccelRange(). … … 265 268 266 269 /**************************************************************************/ 267 /*! 270 /*! 268 271 @brief read the Y parameter of the onboard accelerometer. Value returned is 269 272 defined by setAccelRange(). … … 278 281 279 282 /**************************************************************************/ 280 /*! 283 /*! 281 284 @brief read the Z parameter of the onboard accelerometer. Value returned is 282 285 defined by setAccelRange(). … … 291 294 292 295 /**************************************************************************/ 293 /*! 296 /*! 294 297 @brief read the onboard thermistor. 295 298 @returns temperature reading in Centigrade. … … 322 325 323 326 /**************************************************************************/ 324 /*! 327 /*! 325 328 @brief read the onboard thermistor. 326 329 @returns temperature reading in Farenheight. … … 333 336 334 337 /**************************************************************************/ 335 /*! 338 /*! 336 339 @brief get a color value from the color wheel. 337 340 @param WheelPos a value 0 to 255 … … 353 356 354 357 /**************************************************************************/ 355 /*! 358 /*! 356 359 @brief detect a color value from the light sensor 357 360 @param red the pointer to where the red component should be stored. 358 361 @param green the pointer to where the green component should be stored. 359 @param blue the pointer to where the blue component should be stored. 362 @param blue the pointer to where the blue component should be stored. 360 363 @returns the components of the detected colors in the passed pointers. 361 364 */ … … 395 398 396 399 /**************************************************************************/ 397 /*! 400 /*! 398 401 @brief check whether or not this device is a CircuitPlayground Express. 399 402 @returns True if the device is a CircuitPlayground Express, false if it is a 'classic'. -
trunk/Arduino/libraries/Adafruit_Circuit_Playground/README.md
r3 r20 1 # Adafruit CircuitPlayground Library [](https://travis-ci.org/adafruit/Adafruit_CircuitPlayground)1 # Adafruit CircuitPlayground Library [](https://travis-ci.com/adafruit/Adafruit_CircuitPlayground) 2 2 3 3 <img src="https://cdn-shop.adafruit.com/970x728/3333-01.jpg" height="300"/> -
trunk/Arduino/libraries/Adafruit_Circuit_Playground/library.properties
r3 r20 1 1 name=Adafruit Circuit Playground 2 version=1.8. 42 version=1.8.6 3 3 author=Adafruit 4 4 maintainer=Adafruit <info@adafruit.com> -
trunk/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_LIS3DH.h
r3 r20 180 180 uint8_t spixfer(uint8_t x = 0xFF); 181 181 182 183 int32_t _sensorID;184 int8_t _i2caddr;185 186 182 // SPI 187 183 int8_t _cs, _mosi, _miso, _sck; 184 185 int8_t _i2caddr; 186 int32_t _sensorID; 188 187 }; 189 188 -
trunk/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_NeoPixel.cpp
r3 r20 713 713 // table (in flash memory) holding an 8-bit unsigned sine wave (0-255). 714 714 static const int _SBASE_ = __COUNTER__ + 1; // Index of 1st __COUNTER__ below 715 #define _S1_ ( sin((__COUNTER__ - _SBASE_) / 128.0 * M_PI) + 1.0) * 127.5 + 0.5,715 #define _S1_ (uint8_t) ((sin((__COUNTER__ - _SBASE_) / 128.0 * M_PI) + 1.0) * 127.5 + 0.5), 716 716 #define _S2_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ _S1_ // Expands to 8 items 717 717 #define _S3_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ _S2_ // Expands to 64 items … … 721 721 #define _GAMMA_ 2.6 722 722 static const int _GBASE_ = __COUNTER__ + 1; // Index of 1st __COUNTER__ below 723 #define _G1_ pow((__COUNTER__ - _GBASE_) / 255.0, _GAMMA_) * 255.0 + 0.5,723 #define _G1_ (uint8_t) (pow((__COUNTER__ - _GBASE_) / 255.0, _GAMMA_) * 255.0 + 0.5), 724 724 #define _G2_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ _G1_ // Expands to 8 items 725 725 #define _G3_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ _G2_ // Expands to 64 items -
trunk/Arduino/libraries/Adafruit_Circuit_Playground/utility/talkie.cpp
r3 r20 9 9 #define USEC ((1000000 + (FS / 2)) / FS) // Sample period (microseconds) 10 10 11 static const int16_t PROGMEM11 static const uint16_t PROGMEM 12 12 tmsK1[] = {0x82C0,0x8380,0x83C0,0x8440,0x84C0,0x8540,0x8600,0x8780, 13 13 0x8880,0x8980,0x8AC0,0x8C00,0x8D40,0x8F00,0x90C0,0x92C0, … … 19 19 0x69C0,0x6CC0,0x6F80,0x71C0,0x73C0,0x7580,0x7700,0x7E80}; 20 20 21 static const int8_t PROGMEM21 static const uint8_t PROGMEM 22 22 tmsK3[] = {0x92,0x9F,0xAD,0xBA,0xC8,0xD5,0xE3,0xF0, 23 23 0xFE,0x0B,0x19,0x26,0x34,0x41,0x4F,0x5C},
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)