Skip to content

Instantly share code, notes, and snippets.

/*
* USE THIS FOR ALL NEW BOARDS
* TO ENABlE WIRELESS UPLOAD OF CODE
* @CMoz
* Working and uploaded code to ESP 32 board
*
* edited oct 2020
*/
/* -----------------------------------------------------------------------
* Title: advent.c
* Flicker 4 LEDs
*
* Author: Alexander Weber
* http://tinkerlog.com
* Date: 22.11.2009
* Hardware: ATtiny13v
* Software: CrossPack-AVR-20090415
*
@cmoz
cmoz / ultraSonic.txt
Last active March 23, 2022 14:03
Ultrasonic Sensor
#include <HCSR04.h>
UltraSonicDistanceSensor distanceSensor(13, 12); // Initialize sensor that uses digital pins 13 and 12.
void setup () {
Serial.begin(9600); // We initialize serial connection so that we could print values from sensor.
}
void loop () {
// Every 500 miliseconds, do a measurement using the sensor and print the distance in centimeters.
@cmoz
cmoz / SampleNeo
Created March 23, 2022 14:03
SampleNeoPixel
// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
#include <Adafruit_CircuitPlayground.h>
uint8_t pixeln = 0;
int capsense[10];
void setup() {
CircuitPlayground.begin();
}
void loop() {
@cmoz
cmoz / ColSenseNeoOLED
Created March 23, 2022 14:11
Colour Sensor with NeoPixels and OLED
#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);
@cmoz
cmoz / TouchServo
Created March 23, 2022 14:16
touch servo example via Andrew Quitmeyer
/*
This is an extension of Martin2250's ADC touch examples
to have the library built in, for rapid deployment in workshop settings
In this one, you can hook a servo directly up
and if the sensor passes a threshold, the servo will flip to 180
*/
#include "ADCTouch.h"
@cmoz
cmoz / TouchWiggleServo
Created March 23, 2022 14:17
Touch Wiggle Servo example via Andrew Quitmeyer
/*
This is an extension of Martin2250's ADC touch examples
to have the library built in, for rapid deployment in workshop settings
In this one, you can hook a servo directly up
and if the sensor passes a threshold, the servo will wiggle around
*/
#include "ADCTouch.h"
@cmoz
cmoz / ServoMoverToMeasureTouch
Created March 23, 2022 14:19
Servo moves to a touch input, via Andrew Quitmeyer
/*
This is an extension of Martin2250's ADC touch examples
to have the library built in, for rapid deployment in workshop settings
In this one, you can hook a servo directly up and the servo will move with regard to the cap touch measurement
*/
#include "ADCTouch.h"
/*
* Created by ArduinoGetStarted.com
*
* This example code is in the public domain
*
* Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-long-press-short-press
*/
// constants won't change. They're used here to set pin numbers:
const int BUTTON_PIN = 7; // the number of the pushbutton pin