Skip to content

Instantly share code, notes, and snippets.

View TURBULENTE's full-sized avatar

turbulente TURBULENTE

View GitHub Profile
@TURBULENTE
TURBULENTE / AFMotor_stepper_potentiometer.ino
Created March 5, 2017 19:42
Stepper + Potentiometer Arduino
// 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>
@TURBULENTE
TURBULENTE / light_servo.ino
Created July 4, 2016 23:15
Code test for making a servo move with a light resistor using Arduino UNO.
#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);
}
//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
@TURBULENTE
TURBULENTE / bend_sensor_read_at45.ino
Created June 29, 2016 17:31
Data reading using ATtiny 45
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0,2); //rx,tx (set 2 pins as rx,tx)
byte sensorPin = 3;
void setup() {
mySerial.begin(9600);
@TURBULENTE
TURBULENTE / momo_receiver.ino
Created June 13, 2016 00:12
Transmitter & receiver codes using the nrF24L01+ module, and MOMO board based on Arduino Leonardo & FabLeo's design. Arduino Compatible.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
int poten;
void setup()
void read_data(){
while (myPort.available() > 0) { // If data is available
byte1 = byte2;
byte2 = byte3;
byte3 = byte4;
byte4 = low;
low = high;
high = myPort.read();
@TURBULENTE
TURBULENTE / bend_sensor_visualization.pde
Created June 5, 2016 20:47
bend_sensor_visualization
// 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
@TURBULENTE
TURBULENTE / nrf_hola_radio_receiver.ino
Created May 30, 2016 16:50
Hola radiocomunicación! + nrf24L01+
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
@TURBULENTE
TURBULENTE / receiver_01.ino
Created May 30, 2016 16:37
nrf24L01 tests
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{