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
// Processing.js example sketch | |
int fontsize = 24; | |
void setup() { | |
size(200, 200); | |
stroke(0); | |
fill(0); | |
textFont(createFont("Arial",fontsize)); | |
noLoop(); |
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 is a test of a soft | |
//that will never be published | |
void setup(){ | |
algo wrong here | |
println("this is correct text"); | |
println("this is correct text with syntax error") | |
} |
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; // create servo object to control a servo | |
int pos=0; // variable to store the servo position | |
int URPWM=3; // PWM Output 0-25000us,every 50us represent 1cm | |
int URTRIG=5; // PWM trigger pin | |
boolean up=true; // create a boolean variable | |
unsigned long time; // create a time variable | |
unsigned long urmTimer = 0; // timer for managing the sensor reading flash rate |
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
// Code example for Animatronics class - NYU Shanghai 2016 | |
// See class details at http://ima.nyu.sh/animatronics | |
// Hardware part required: https://www.dfrobot.com/index.php?route=product/product&product_id=91 | |
// Hardware part required: WiiChuck | |
// Library required hosted at https://github.com/todbot/wiichuck_adapter/tree/master/firmware/WiichuckDemo | |
// Instructions at http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/ | |
// Tutorial at http://hacknmod.com/hack/how-to-cheap-accelerometer-using-wii-nunchuck/ | |
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
import processing.serial.*; | |
import cc.arduino.*; | |
import ddf.minim.*; | |
Arduino arduino; | |
Minim minim; | |
AudioInput in; | |
color red; | |
color green; |
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
int speedPin_M1 = 5; //M1 Speed Control | |
int speedPin_M2 = 6; //M2 Speed Control | |
int directionPin_M1 = 4; //M1 Direction Control | |
int directionPin_M2 = 7; //M1 Direction Control | |
void setup() { | |
} | |
void loop() { | |
carAdvance(100, 100); |
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
const int speedPin_M1 = 5; //M1 Speed Control | |
const int speedPin_M2 = 6; //M2 Speed Control | |
const int directionPin_M1 = 4; //M1 Direction Control | |
const int directionPin_M2 = 7; //M1 Direction Control | |
const int LDR = A0; // Analog input pin that the potentiometer is attached to | |
int speedMotors = 0; | |
const int slow = 50; | |
const int fast =255; |
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
#define DEBUG | |
const int speedPin_M1 = 5; //M1 Speed Control | |
const int speedPin_M2 = 6; //M2 Speed Control | |
const int directionPin_M1 = 4; //M1 Direction Control | |
const int directionPin_M2 = 7; //M1 Direction Control | |
const int LDR0 = A0; // LDR sensor to GND and 1k to 1k resistor | |
const int LDR1 = A1; // LDR sensor to GND and 1k to 1k resistor | |
const int slow = 30; | |
const int fast = 120; |
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
#define DEBUG | |
const int speedPin_M1 = 5; //M1 Speed Control | |
const int speedPin_M2 = 6; //M2 Speed Control | |
const int directionPin_M1 = 4; //M1 Direction Control | |
const int directionPin_M2 = 7; //M1 Direction Control | |
const int LDR0 = A0; // LDR sensor to GND and 1k to 1k resistor | |
const int LDR1 = A1; // LDR sensor to GND and 1k to 1k resistor | |
const int slow = 30; |
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
#define DEBUG | |
#include <PID_v1.h> | |
//Define Variables we’ll be connecting to | |
double Setpoint, Input, Output; | |
//Specify the links and initial tuning parameters | |
PID myPID(&Input, &Output, &Setpoint, 5, 0, 0.5, REVERSE); | |
const int speedPin_M1 = 5; //M1 Speed Control | |
const int speedPin_M2 = 6; //M2 Speed Control | |
const int directionPin_M1 = 4; //M1 Direction Control |
OlderNewer