Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

int ledPin = 9;
int flexPin = 10;
int flexValue;
void setup(){
pinMode(ledPin, OUTPUT);
pinMode(flexPin, INPUT);
Serial.begin(9600);
}
#include <Adafruit_CircuitPlayground.h>
float X, Y, Z;
#define MOVE_THRESHOLD 3 //To 10, lower the number more sensitive
void setup() {
Serial.begin(9600);
CircuitPlayground.begin();
}
#include <Adafruit_CircuitPlayground.h>
uint8_t pixeln = 0;
int capsense[10];
void setup() {
CircuitPlayground.begin();
}
void loop() {
#include <Wire.h> //include Wire.h to be able to communicate through I2C on Arduino board
#include "Adafruit_TCS34725.h" //Colour sensor library
#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"
#include "Adafruit_NeoPixel.h"
//Create colour sensor object declaration, to see effects of different integration time and gain
//settings, check the datatsheet of the Adafruit TCS34725.
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);
#include <Wire.h> //include Wire.h to be able to communicate through I2C on Arduino board
#include "Adafruit_TCS34725.h" //Colour sensor library
#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"
//Create colour sensor object declaration, to see effects of different integration time and gain
//settings, check the datatsheet of the Adafruit TCS34725.
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);
#define SCREEN_WIDTH 128 // OLED display width, in pixels
@cmoz
cmoz / MovingConductiveTouchCP_WS22
Created March 25, 2022 15:33
Using Circuit Playground board, capacitive touch with servo movement
// Circuit is using 2 Servos
// You can use 1 servo if you want
// Servos on Pins 3 and 10
// @cmoz
// Input is for 6 items max with this circuit
// Other pins are for input, croc clip or wire to leaf or other
// input, must be conductive to work - e.g. dry plants not good
// sound can be turned off
@cmoz
cmoz / servoTouchPin
Created March 23, 2022 14:35
Hardware Touch sensor pin on board, and servo
/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-touch-sensor-servo-motor
*/
#include <Servo.h>
@cmoz
cmoz / BtnServo
Created March 23, 2022 14:31
accurate button and servo movement with debounce
/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-servo-motor
*/
#include <Servo.h>
#include <ezButton.h>
@cmoz
cmoz / 4AnalogValuesSerialPlotter
Created March 23, 2022 14:29
Reads in 4 analog values and outputs to serial plotter
/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-serial-plotter
*/
void setup() {
Serial.begin(9600);
@cmoz
cmoz / BtnLowToHigh
Created March 23, 2022 14:27
Simple button state from low to high, no resistor used in hook up
// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin
// Variables will change:
int lastState = HIGH; // the previous state from the input pin
int currentState; // the current reading from the input pin
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);