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
#include "SD.h" | |
#define SD_ChipSelectPin 10 | |
#include "TMRpcm.h" | |
#include "SPI.h" | |
#include <CapacitiveSensor.h> | |
TMRpcm tmrpcm; | |
//This is the code for our sound, we have two capacitive | |
// touch sensors, when touched they each play/loop a different sound | |
// from the SD card reader |
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
#include <CapacitiveSensor.h> //library | |
#include <Servo.h> //library | |
CapacitiveSensor cs_2 = CapacitiveSensor(7,5); //pins for sensor | |
Servo myservo; | |
//This is the code for our continuous servo motor, | |
// we have one capacitive touch sensor, when | |
// touched the motor spins |
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
const int switchPin = 2; // switch input | |
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) | |
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) | |
//const int motor2pin=5; | |
const int enablePin = 9; | |
int reading; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(switchPin,INPUT); |
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
#include <Stepper.h> | |
//include library | |
const int stepsPerRevolution = 513; //makes full revolution | |
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); | |
void setup() { | |
// set the speed at 60 rpm: |
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
/* | |
This P5 sketch is a template for getting started with Serial Communication. | |
The SerialEvent callback is where incoming data is received | |
By Arielle Hein, adapted from ITP Phys Comp Serial Labs | |
Edited March 12 2019 | |
*/ |
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
int incomingByte; | |
int red=10; //redLED | |
int green=9; //greenLED | |
void setup() { | |
Serial.begin(9600); | |
} |
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
int analogPin=A0; //photoresistors analog input | |
int speaker=8; //speaker | |
int freq; | |
int reading; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(analogPin,INPUT); //input | |
pinMode(speaker,OUTPUT); //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
int poten=A0; //potentiometer analog input | |
int reading; //read the potentiometer | |
int slider=A1; //variable resistor (slider) analog input | |
int readingTwo; //read the slider | |
int ledOne=9; //2 yellow LEDs | |
int ledTwo=10; //1 red LED | |
void setup() { | |
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
int button1=8; | |
int LEDs=7; | |
int state=0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(button1,INPUT); | |
pinMode(LEDs, OUTPUT); |