This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hacked from: https://lastminuteengineers.com/drv8833-arduino-tutorial/ | |
// Define the control inputs | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#define SCREEN_WIDTH 128 // OLED display width, in pixels | |
#define SCREEN_HEIGHT 64 // OLED display height, in pixels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ***************************************** | |
// Reaction timer using interrupt | |
// ***************************************** | |
#define BUTTON_PIN 2 | |
#define LED_PIN 8 | |
// This must be declared volatile since it is accessed from | |
// the ISR and from loop() | |
//https://en.wikipedia.org/wiki/Volatile_(computer_programming) | |
static volatile int isr_counter = 0 ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Arduino "No hardware" touch switch | |
// Based on https://github.com/todbot/TouchyTouch | |
#include "TouchyTouch.h" | |
#define STATUS_LED 4 | |
#define SENSE_PIN 12 | |
const int touch_pin = SENSE_PIN; | |
// Install as TouchyTouch library in Arduino. | |
TouchyTouch touches ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hacked from: https://lastminuteengineers.com/drv8833-arduino-tutorial/ | |
// Define the control inputs | |
#define MOT_A1_PIN 6 | |
#define MOT_A2_PIN 5 | |
void setup(void) | |
{ | |
// Set all the motor control inputs to OUTPUT | |
pinMode(MOT_A1_PIN, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Headers for sd1306 display | |
/* Based on code Written by Limor Fried/Ladyada for Adafruit Industries, | |
with contributions from the open source community. | |
BSD license, check license.txt for more information | |
All text above, and the splash screen below must be | |
included in any redistribution. | |
**************************************************************************/ | |
#include <SPI.h> | |
#include <Wire.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TinySender.cpp | |
* | |
* Example for sending using TinyIR. By default sends simultaneously using all supported protocols | |
* To use a single protocol, simply delete or comment out all unneeded protocols in the main loop | |
* Program size is significantly reduced when using a single protocol | |
* For example, sending only 8 bit address and command NEC codes saves 780 bytes program memory and 26 bytes RAM compared to SimpleSender, | |
* which does the same, but uses the IRRemote library (and is therefore much more flexible). | |
* | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Based on code Written by Limor Fried/Ladyada for Adafruit Industries, | |
with contributions from the open source community. | |
BSD license, check license.txt for more information | |
All text above, and the splash screen below must be | |
included in any redistribution. | |
**************************************************************************/ | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AnalogReadSerial | |
Reads an analog input on pin 0, prints the result to the Serial Monitor. | |
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu). | |
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. | |
This example code is in the public domain. | |
https://docs.arduino.cc/built-in-examples/basics/AnalogReadSerial/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read and process hall effect sensor for use as tach | |
// See https://www.allelcoelec.com/blog/A3144-Hall-Effect-Sensor-Pinout,Alternatives,and-Applications.html for hookup | |
#define HALL_EFFECT_PIN 2 | |
int sensor_value = 0 ; // output from hall sensor, low for detect | |
void setup() { | |
// put your setup code here, to run once | |
Serial.begin( 115200 ) ; |
NewerOlder