GithubHelp home page GithubHelp logo

adafruit_circuitplayground's Introduction

Adafruit CircuitPlayground Library Build StatusDocumentation

Description

All in one library to control Adafruit's Circuit Playground board. Requires no other dependencies and exposes all Circuit Playground components in a simple to use class. Adafruit Circuit Playground Express is a high-level library that provides objects that represent CircuitPlayground hardware.

Installation

First Method

image

  1. In the Arduino IDE, navigate to Sketch > Include Library > Manage Libraries
  2. Then the Library Manager will open and you will find a list of libraries that are already installed or ready for installation.
  3. Then search for Circuit playground using the search bar.
  4. Click on the text area and then select the specific version and install it.

Second Method

  1. Navigate to the Releases page.
  2. Download the latest release.
  3. Extract the zip file
  4. In the Arduino IDE, navigate to Sketch > Include Library > Add .ZIP Library

Features

  • Complete Package

    Everything that is needed to run Arduino code on Circuit Playground is wrapped up into a tidy library that integrates all the sensing and lighting.

  • Self-contained

    Requires no other dependencies and exposes all Circuit Playground components in a simple to use class.

  • High-Level Library

    This high-level library provides objects that represent CircuitPlayground hardware.

  • Give back

    The library is free; you don’t have to pay for anything. However, if you want to support the development, or just thank the author of the library by purchasing products from Adafruit! Not only you’ll encourage the development of the library, but you’ll also learn how to best use the library and probably some C++ too

  • MIT License

    Adafruit playground library is open-source and uses one of the most permissive licenses so you can use it on any project.

    • Commercial use
    • Modification
    • Distribution
    • Private use

Functions

  • begin()
  • readCap()
  • redLED()
  • slideSwitch()
  • leftButton()
  • rightButton()
  • playTone()
  • lightSensor()
  • soundSensor()
  • motionX()
  • motionY()
  • motionZ()
  • temperature()
  • temperatureF()
  • colorWheel()
  • sensorColor()
  • isExpress()

Examples

There are many examples implemented in this library. One of the examples is below. You can find other examples here

soundPressureLevel.ino

#include <Adafruit_CircuitPlayground.h>
void setup() {
  CircuitPlayground.begin();
  Serial.begin(115200);
}
void loop() {
  Serial.println(CircuitPlayground.mic.soundPressureLevel(50));
}

Contributing

If you want to contribute to this project:

  • Report bugs and errors
  • Ask for enhancements
  • Create issues and pull requests
  • Tell others about this library
  • Contribute new protocols

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Credits

The author and maintainer of this library are Limor Fried/Ladyada and others for Adafruit Industries [email protected].

Based on previous work by:

  • T. DiCola
  • P. Y. Dragon
  • deanm1278
  • C. Nelson
  • E. Saadia
  • per1234
  • driveblock
  • C. Young
  • D. Cogliano

This is a library for the Adafruit CircuitPlayground boards:

Check out the links above for our tutorials and wiring diagrams.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

License

This library is licensed under MIT license. All text above must be included in any redistribution.

adafruit_circuitplayground's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_circuitplayground's Issues

CircuitPlayground.readCap() breaks Adafruit_NeoPixel_ZeroDMA on CPX

On Circuit Playground Express, calling CircuitPlayground.readCap() makes Adafruit_NeoPixel_ZeroDMA display random pixels. Try with the following sketch:

#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_NeoPixel_ZeroDMA.h>

#define PIXELS_PIN     8
#define PIXELS_NUM    10

#define TOUCH_PIN     A1

Adafruit_NeoPixel_ZeroDMA pixels(PIXELS_NUM, PIXELS_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  CircuitPlayground.begin();
  pixels.begin();
  pixels.setBrightness(24);
}

void loop() {
  int c = CircuitPlayground.readCap(TOUCH_PIN);

  pixels.fill(pixels.Color(128, 0, 255));
  pixels.show();
  delay(10);
}

This is just the simplest example to show the problem without additional hardware. I'm in fact trying to use Adafruit_NeoMatrix_ZeroDMA on pin A2, but it exhibits exactly the same problem. When commenting out the readCap() line everything works as expected.

API Documentation

Hi,
This is a great library but I struggled with using it because I didn't know where to look for the the available methods. I just happened to stumble upon some of the methods that I needed in tutorials and then I found the rest in the header files.
I think the addition of a README.md file would be beneficial to users.

Something along these lines:

# Adafruit_CircuitPlayground

## Methods

### boolean CircuitPlayground.begin(uint8_t brightness)

Initializes the library.

...

### boolean leftButton(void)

check the state of the left button.

### boolean rightButton(void)

check the state of the right button.
...

### void CircuitPlayground.senseColor(uint8_t& red, uint8_t& green, uint8_t& blue)

Perform basic RGB color sensing.
The return values are assigned to the parameters.

### uint32_t CircuitPlayground.senseColor()

Perform basic RGB color sensing.

...

I was eventually able to do what I wanted, so I do not thing this is required, but I do think it will
lower the barrier to entry.

Thank you!

User contributed examples

I have a game demo I could add to the library that demonstrates the accelerometer and other components of the Circuit Playground. Are you accepting user contributions of demos? It could be placed in the examples folder or a new contrib folder could be used for community contributions. Video of the game demo can be seen at https://youtu.be/JV2Jdn3KFzo

If there is another way to contribute to a Circuit Playground demo repository, let me know. I think it would be great to have more examples to get more people excited about the device and I would be happy to contribute code to it.

redLed() no longer working for CPC

Re this thread:
https://forums.adafruit.com/viewtopic.php?f=58&t=152174

Seems to be related to low level register writes and timer setup in Adafruit_CPlay_Speaker::begin():

PLLFRQ = (PLLFRQ & 0xCF) | 0x30; // Route PLL to async clk
TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on
TCCR4B = _BV(PWM4X) | _BV(CS40); // PWM invert, 1:1 prescale
TCCR4D = 0; // Fast PWM mode
TCCR4E = 0; // Not enhanced mode
DT4 = 0; // No dead time
noInterrupts(); // TC4H accesses must be atomic
TC4H = 0; // Not 10-bit mode
OCR4C = 255; // TOP
TC4H = 0;
OCR4A = 127; // 50% duty (idle position) to start
interrupts();

Memory allocation error on CPX

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: Circuit Playground Express rev G

  • Arduino IDE version (found in Arduino -> About Arduino menu): Mu 1.0.0.beta15, CircuitPython 2.2.3

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

Program to demonstrate writing out string data via HID keyboard emulation on CPX:

Circuit Playground Express Keyboard Emulation Example

2018 for Getting Started with Circuit Playground Express

import time
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_circuitplayground.express import cpx

kbd = Keyboard()
layout = KeyboardLayoutUS(kbd)

while True:
if cpx.button_a:
# Type your name followed by Enter (a newline).
layout.write('Kim Possible\n')

elif cpx.button_b:
    # Type out the name of your development board
    layout.write('Circuit Playground Express\n')

time.sleep(0.1)

I can press button A and get the text out.
With one press of button B, it will print partial text then through the following error

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 19, in
File "adafruit_hid/keyboard_layout_us.py", line 209, in write
MemoryError: memory allocation failed, allocating 460 bytes

Press any key to enter the REPL. Use CTRL-D to reload.

A bit time sensitive due to getting my CPX book to publisher this month. Thanks, Mike

Preprocessor mismatch for CPX

Re this thread:
https://forums.adafruit.com/viewtopic.php?f=58&t=157171

Simple issue. Just some preprocessor stuff.

Recent updates added #if that uses __SAMD21__

#elif defined(__SAMD21__) // Circuit Playground Express

vs. BSP which uses __SAMD21G18A__
https://github.com/adafruit/ArduinoCore-samd/blob/a6e9eb3686c0899221d2f81829f0b267b2e69240/boards.txt#L184
so pulldown/ups aren't being engaged.

'analogPinToChannel' not declared in scope : Adafruit_CPlay_Mic.cpp

  • Arduino board: Circuit PlayGround Dev. Edition
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.12
  • Steps to reproduce the problem:
    Compile and upload ~/Arduino/libraries/Adafruit_Circuit_Playground/examples/demo.ino
~/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_Mic.cpp: In member function 'int Adafruit_CPlay_Mic::peak(uint16_t)':
~/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_Mic.cpp:27:37: error: 'analogPinToChannel' was not declared in this scope
   channel     = analogPinToChannel(4); // Pin A4 to ADC channel
                                     ^
~/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_Mic.cpp: In member function 'void Adafruit_CPlay_Mic::capture(int16_t*, uint8_t)':
~/Arduino/libraries/Adafruit_Circuit_Playground/utility/Adafruit_CPlay_Mic.cpp:84:37: error: 'analogPinToChannel' was not declared in this scope
   channel     = analogPinToChannel(4); // Pin A4 to ADC channel
                                     ^
exit status 1
Error compiling for board Arduino/Genuino Uno.

Should playTone() be blocking?

  • Arduino board: Circuit Playground (library up to 1.6.3)
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.11
  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): Use playTone() without delay()

Ref. this forum thread:
https://forums.adafruit.com/viewtopic.php?f=58&t=102459

Ref. current library documentation:
https://learn.adafruit.com/circuit-playground-lesson-number-0/mini-speaker#library-reference

Ref. CircuitPlayground library playTone() function:
https://github.com/adafruit/Adafruit_CircuitPlayground/blob/master/Adafruit_CircuitPlayground.cpp#L79

Ref. Arduino library tone() function:
https://www.arduino.cc/en/Reference/Tone
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Tone.cpp#L243

The current Circuit Playground playTone() function simply calls the Arduino library tone() function. The tone generation is done using timer interrupts. The call to tone() configures the timer and returns. This leads to the following lines of code only producing the second (800Hz) sound:

CircuitPlayground.playTone(500, 1000);
CircuitPlayground.playTone(800, 1000);

This is fixed quite simply using delay():

CircuitPlayground.playTone(500, 1000); delay(1000);
CircuitPlayground.playTone(800, 1000); delay(1000);

However, a blocking behaviour may be better suited for CircuitPlayground. Or at least the option for both (blocking/non-blocking) with blocking being the default.

Having trouble with the Speech examples

I am having trouble with the Speech examples… Getting just buzz and hiss, no speech. Arduino IDE 1.8.5, Playground Circuit 1.8.0 library. Chip is Playground Circuit classic. Does anyone have a clue?
Rest of the examples seem to work… Tried on Windows and OSX and in Arduino Web Editor – same story, no speech, just hissing and buzzing.

Please, suggest?

Thanks,
Roman

Bluefruit CP - cap touch sound demo does not seem to work when pushing the sensors, though it will play the series of tones.

Hi I tried this program on the Circuit Playground Blue Fruit and everything works perfect, save the capacitive touch piano. It does still play the series of tones independent of the touch input.
I adjusted the cap cut off values up and down by 200, though did not change anything.

Wondering if there is some alternate way the capacitive touch / tones are accessed in the Bluefruit model?

  • Arduino board: CP Blue Fruit

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.16

  • Using code included in the Arduino IDE Adafruit example. Downloaded 12/20/21

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): compiled and uploaded unedited code to CP Bluefruit

Thank you

CircuitPlayground.readCap() breaks analogRead

#include <Adafruit_CircuitPlayground.h>

void setup() {
  CircuitPlayground.begin();
  Serial.begin(9600);
}

void loop() {

  int sensorValue = analogRead(A1);
  //CircuitPlayground.readCap(A2);

  Serial.println(sensorValue);

  delay(20);
}

This code works until CircuitPlayground.readCap(A2); is uncommented. Once I do that, analogRead(A1) can never reach 0. Even A1 is tied to GND. It seems capacitive touch used QTOUCH lib so I'm not able to fix it myself this time.

Suggestion on debounced button functions

  • Arduino board: Circuit Playground Rev B
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.11 Windows

Suggest you add two new functions to augment CircuitPlayground.rightButton and .leftButton

CircuitPlayground.debounced.leftButton
CircuitPlayground.debounced.rightButton

or something similar to help the less experienced and educators on getting a fully debounced switch state rather than having to add in a bunch of code to do the debouncing by themselves.

Thank you for your consideration. Mike

Package discription is no longer accurate.

Library Description is incorrect. From library.properties:

sentence=All in one library to control Adafruit's Circuit Playground board.
paragraph=All in one library to control Adafruit's Circuit Playground board.  Requires no other dependencies and exposes all Circuit Playground components in a simple to use class.

commit: 9b216be added a depends= line to library.properties, creating six dependencies, which in turn bring in an even larger tree of sub-dependencies.

The description is no longer accurate and should be changed to reflect this.

Adafruit_SleepyDog.h not found when compiling megademo example.

  • Arduino board: Adafruit Circuit Playground Classic

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.6 (Hourly)

When flashing the Circuit Playground library's megademo example, I was presented with an error citing that Adafruit_SleepyDog.h was missing. After searching the github I only see it referenced one other place, which is .travis.yml. Specifically:

install:
   - arduino --install-library "Adafruit LED Backpack Library","Adafruit GFX Library","Adafruit SleepyDog Library","Adafruit Zero FFT Library"

I checked my libraries and found that Adafruit SleepyDog Library was not installed, despite having just recently installed the Adafruit Circuit Playground library. I tried deleting the Playground library and then reinstalling it, which worked fine, but SleepyDog still was not present. Only after searching for it manually in the library manager and installing it did megademo compile and flash correctly.

I'd venture to guess something is going wrong with the install script. I wasn't aware libraries could even install other libraries as dependencies. I assume that's what's supposed to be happening here and that'd be a neat and interesting feature if it worked :) Ideas?

My hourly is a bit old but it's still newer than the latest release:
1.8.6 Hourly Build 2018/04/19 10:37

NeoPixel issues

  • Arduino board: Circuit Playground Rev B
  • Arduino IDE version 1.6.8

Sometimes when uploading code the NeoPixel below the GND pin next to the USB connector will light green and stay on. On next upload it will turn off. This was the code I was using:

include <Adafruit_CircuitPlayground.h>

void setup() {
CircuitPlayground.begin(); // initialize the Circuit Playground library
}

void loop() {
int value , sound;
if(CircuitPlayground.slideSwitch()) { // if the slide switch is on
value = CircuitPlayground.lightSensor(); // read the light sensor
sound = map(value, 5, 1000, 131, 1760); // map light values to music values
CircuitPlayground.playTone(sound, 100); // play sound for 100 milliseconds
}
}

Also I had run a sketch to light the NeoPixels in Pokemon colors. I then uploaded a sketch that did not do anything with the NeoPixels (it just played tones on the speaker). The NeoPixels stayed lit even with a new sketch loaded.

The brute force method would be for the begin function to make sure all the NeoPixels are off but there might be a more specific issue to fix.

Speaker on/off broken on CPX

Just need to configure digital 11 for output somewhere. The removal of the call to speaker.begin() in #41 removed that part of the setup.

Discovered while helping here:
https://forums.adafruit.com/viewtopic.php?f=58&t=154242

#include <Adafruit_CircuitPlayground.h>

void setup() {
  CircuitPlayground.begin();
  //uncomment this and it will work again
  //pinMode(11, OUTPUT);
  CircuitPlayground.speaker.off();
}

void loop() {
  CircuitPlayground.playTone(500, 100);
  delay(1000);
}

C:\Users\Dr.Zahid\Documents\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp: In member function 'void Adafruit_CPlay_Mic::capture(int16_t*, uint16_t)': C:\Users\Dr.Zahid\Documents\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp:68:37: error: 'analogPinToChannel' was not declared in this scope channel = analogPinToChannel(4); // Pin A4 to ADC channel ^ exit status 1 Error compiling for board Arduino Nano.

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

Capacitive Touch

  • Arduino board: Circuit Playground Rev B
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.8
  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW
    There is no clear method for using the capacitive touch feature. You can define which pins to set for capacitive, does one need to do the send/receive like in the Teensy and AP pages? I've got a great Simon game ready but reading the capacitive pads is wonky, they are reading themselves. Thanks!

Examples do not compile

Setup

  • Arduino board: Circuit Playground Express ATSAMD21
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.3 (MacOS and Ubuntu 17.04)

Reproduction of the bug

Installed Arduino's SAMD Boards via the Board manager (I had no luck at all to get CPE working with the Adafruit's AVR Boards manager)
Installed the last version of Circuit Playground Library (1.6.9) via the Library manager
Run the demo example.

The example won't compile and I Got an error message saying two things (macOs):

  1. /Applications/Arduino/libraries/Adafruit_CircuitPlayground/utility/CP_Boards.h:708:2: error: #error "Please edit Boards.h with a hardware abstraction for this board"

  2. That two libraries were found and only one was used. (I read this thread which clarifies a bit the situation)

Temporary fix

After multiple reinstallation of the board manager and the library, I finally got the examples to compile (with a lot of warnings!) and upload on board by changing the #include directive from <Adafruit_CircuitPlayground.h> to <Adafruit_Circuit_Playground.h> (notice the second underscore).

Suggestion

I am a bit puzzled by that behaviour and wanted to know if I am alone.
If not, maybe we could fix that by changing the #include in all examples ?

Example programs broken

  • Arduino board: Circuit playground

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.5

  • Current example programs are broken . All generate errors on compile example shown in attached TXT
    New Text Document (4).txt

bug in Adafruit_CPlay_Speaker::set()

in Adafruit_CPlay_Speaker::set() in Adafruit_CPlay_Speaker.cpp, i believe
TCCR4A = value;
should be changed to OCR4A = value;

Also in talkie.cpp in Adafruit_CPlay_Speaker::say() change TCCR4A = 0x7F; to OCR4A = 0x7F;

No implementation for sendRAW

Hi!
I noticed there is no implemented support for sending raw IR data.
The relevant function is written in IRLib_HashRaw.h, which had no include statement in IRLibCPE.h, and in addition the only linkage was broken:
The next line is a line is in IRLib_HashRaw.h:
#define IR_SEND_RAW case 0: IRsendRaw::send((uint16_t*)data,data2,khz); break;

The IR_SEND_RAW macro is used in IRLibCombo.h in IRsend class, in the send method, in order to send raw transmission. That will always result as an illegal cast between uint32_t to uint16_t* .
As a result it's impossible to use this method from the built-in IRsend object in the main object of CircuitPlayground.
I submitted PR of how I think this should be implemented.
Hope that helps :)
Idan

Add example for using external NeoPixels

Fairly easy, but somewhat non-obvious since there is a "built in" implementation for neopixel support here. A new example would help demonstrate how this should be done.

Capacitive touch not working on Bluefruit Playground

It seems that capacitive touch is now working on CPB. For example this doesnt read anything:

CircuitPlayground.readCap(0)

Pinning seems to be different because some caps work, for example A6 = 0, A7 = 1 ... etc.

Add a switch off feature for Accelerometer mouse code.

This is a recommendation for ease of use, regarding the accelerometer mouse code. Once a user codes the mouse, reprogramming the circuit playground can be difficult, forcing the user to then use the mouse to navigate the IDE. This was my experience, and I think other users may have the same issue. The problem could easily be resolved, by including the lines:
....
if (!CircuitPlayground.slideSwitch()) {
return;
}
...

in then the users will have a way to regain normal mouse operations.
Source here:
https://github.com/adafruit/Adafruit_CircuitPlayground/blob/master/examples/accel_mouse/accel_mouse.ino

External neo pixel using pin A1 doesn’t work

When using an external neo pixel on pin A1 (as suggested in multiple posts on adafruit.com) the neo pixels don't light up.

This is due to lines 70 to 84 (Adafruit_CircuitPlayground.cpp) that re-map A1 for cap touch - even though there is nothing mentioned in the H file about its usage.

Fix:
comment out line 70 to 84 if you are not using cap touch.

or

Circuit playground begin() should be overloaded when you pass an external neo pixel pin.

Thermistor Beta Constant

TLDR: Thermistor Beta constant should be 3380.

  • Arduino board: Circuit Playground
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.6.11
  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): Use existing function at a temperature other than 25 deg C.

Ref. this forum thread:
https://forums.ahttps://forums.adafruit.com/viewtopic.php?f=58&t=105254dafruit.com/viewtopic.php?f=58&t=105254

Ref. this datasheet for the Murata NTC NCP15XH103F03RC:
http://www.murata.com/~/media/webrenewal/support/library/catalog/products/thermistor/ntc/r44e.ashx

Datasheet specifies a beta constant of 3380. Current library #defines it to be 3950. The datasheet linked above provides a table of actual resistance vs. temperature values on page 15. Using that, can compare results for Steinhart approximation with different beta constants. As can be seen in the figure below, 3380 provides better results.

fig

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.