This file contains 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 <SPI.h> | |
#include <nRF24L01.h> | |
#include <RF24.h> | |
RF24 radio(7, 8); | |
const byte rxAddr[6] = "00001"; | |
void setup() | |
{ |
This file contains 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 <SPI.h> | |
#include <nRF24L01.h> | |
#include <RF24.h> | |
RF24 radio(7, 8); | |
const byte rxAddr[6] = "00001"; | |
void setup() | |
{ |
This file contains 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 code was created by Citlali Hernández for the Fab Academy program 2016. | |
// Based on Tiago Figueiredo's processing code developed for Fab Acabdemy program in 2014.( http://fabacademy.org/archives/2014/students/figueiredo.tiago/assignments/week15.html ) | |
// - - - - - - - - - - - - - - - l i b r a r i e s - - - - - - - - - - - - - - | |
import processing.serial.*; | |
// - - - - - - - - - - - - - - - v a r i a b l e s - - - - - - - - - - - - - - | |
Serial myPort; // Create object from Serial class | |
int val; // Data received from the serial port | |
int sensorData; // Data received from the serial port with 1,2,3,4 framing numbers filtered out |
This file contains 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
void read_data(){ | |
while (myPort.available() > 0) { // If data is available | |
byte1 = byte2; | |
byte2 = byte3; | |
byte3 = byte4; | |
byte4 = low; | |
low = high; | |
high = myPort.read(); |
This file contains 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 <SPI.h> | |
#include <nRF24L01.h> | |
#include <RF24.h> | |
RF24 radio(7, 8); | |
const byte rxAddr[6] = "00001"; | |
int poten; | |
void setup() |
This file contains 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 <SoftwareSerial.h> | |
SoftwareSerial mySerial(0,2); //rx,tx (set 2 pins as rx,tx) | |
byte sensorPin = 3; | |
void setup() { | |
mySerial.begin(9600); |
This file contains 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
//Bend/Pressure fabric sensor test and smoothing values | |
int sensorPin=A1; | |
int sensorValue=0; | |
int mapped; | |
//Smoothing values | |
const int numReadings = 10; | |
int readings[numReadings]; // the readings from the analog input | |
int readIndex = 0; // the index of the current reading |
This file contains 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 <Servo.h> | |
Servo myservo; | |
int motor = 9; // LED connected to digital pin 9 | |
int val; | |
void setup() { | |
// nothing happens in setup | |
myservo.attach(motor); | |
Serial.begin(9600); | |
} |
This file contains 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
// ConstantSpeed.pde | |
// -*- mode: C++ -*- | |
// | |
// Shows how to run AccelStepper in the simplest, | |
// fixed speed mode with no accelerations | |
// Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library) | |
// And AccelStepper with AFMotor support (https://github.com/adafruit/AccelStepper) | |
// Public domain! | |
#include <AccelStepper.h> |