Skip to content

Instantly share code, notes, and snippets.

@dustynrobots
dustynrobots / Journal of Biomechanics
Created August 2, 2012 02:44
CSL code for Zotero for the Journal of Biomechanics style
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never">
<!-- This style was edited with the Visual CSL Editor (http://steveridout.com/csl/visualEditor/) -->
<info>
<title>Journal of Biomechanics</title>
<id>http://www.zotero.org/styles/journal-of-biomechanics</id>
<author>
<name>Dustyn Roberts</name>
<email>dustyn@nyu.edu</email>
</author>
@dustynrobots
dustynrobots / Strike_a_pose
Created August 23, 2012 18:23
This is code we'll use to test each motor in the servo arm to set the limits of each degree of freedom
#include <Servo.h> // shortcut to code written by awesome people to make our lives easier
Servo myServo; // create servo object to control a servo
int pos; // variable to store the servo position
void setup() // happens once
{
myServo.attach(5); // attaches the servo on pin indicated to the servo object
}
@dustynrobots
dustynrobots / Strike_a_pose_doubletime
Created August 23, 2012 18:34
This is code we'll use to set both motors in the robotic arm to a specific position
#include <Servo.h>
Servo ShoulderServo; // create servo object to control a servo
Servo ElbowServo; // create servo object to control a servo
int elbowPos; // variable to store the servo position
int shoulderPos; // variable to store the servo position
void setup()
{
@dustynrobots
dustynrobots / wiggle_wiggle_wiggle_shoulder
Created August 30, 2012 19:28
This is code we'll use to elevate the motor to a static pose, then wiggle the shoulder motor back and forth
// this code elevates the robotic arm then makes it wiggle back and forth
#include <Servo.h>
Servo ShoulderServo; // create servo object to control a servo
Servo ElbowServo; // create servo object to control a servo
int shoulderPos; // variable to store the servo position
int elbowPos; // variable to store the servo position
@dustynrobots
dustynrobots / wiggle_wiggle_wiggle
Created August 30, 2012 19:43
This is code we'll use to elevate the motor to a static pose, then wiggle both motors back and forth
// this code elevates the robotic arm then makes it wiggle back and forth
#include <Servo.h>
Servo ShoulderServo; // create servo object to control a servo
Servo ElbowServo; // create servo object to control a servo
int shoulderPos; // variable to store the servo position
int elbowPos; // variable to store the servo position
@dustynrobots
dustynrobots / arduino_robotarm
Created August 31, 2012 03:30
This is the Arduino code needed to allow the Processing sketch to move the robot arm
// by David Cummings 8/30/2012
#include <Servo.h>
Servo Elbow; // create servo object to control a servo
Servo Shoulder;
int e_pos = 90; // variable to store the servo position
int s_pos = 90;
char read_char;
@dustynrobots
dustynrobots / processing_robotarm
Created August 31, 2012 03:34
This is the Processing code needed to drive the robot arm
/*
Planar Robotic Arm Visualizer
by Dustyn Roberts 20120622
modified by David Cummings 20120830
*/
import processing.serial.*;
//constants
float a1 = 198; // shoulder-to-elbow "bone" length from Solidworks (mm)
float a2 = 220; // elbow-to-wrist "bone" length from Solidworks (mm) - longer c bracket
@dustynrobots
dustynrobots / Processing - Punctuation
Created October 11, 2012 16:10
Processing - Punctuation
import processing.serial.*; // import the Processing serial library
Serial myPort; // The serial port
float bgcolor = #FAE312; // Background color
float fgcolor; // Fill color
float xpos, ypos; // Starting position of the ball
int sensors[];
void setup() {
@dustynrobots
dustynrobots / Winter's data viz
Created November 28, 2012 15:40
Visualizing data from the appendix of Winter's Biomechanics and Motor Control of Human Movement in MATLAB
clear all; % erases all data
clf; % clears previous plot
%read in all of Winter's relevant data
kinematics = xlsread('Winter_Appendix_data_DR07112012.xlsx','A4.RelJointAngularKinematics','a5:l110');
kinetics = xlsread('Winter_Appendix_data_DR07112012.xlsx','A5.ReactionForces&Moments','a6:x111');
positions = xlsread('Winter_Appendix_data_DR07112012.xlsx','A2.Filtered_Marker_Kinematics','a5:ay111');
time = xlsread('Winter_Appendix_data_DR07112012.xlsx','A4.RelJointAngularKinematics','c5:c110');
%constants
@dustynrobots
dustynrobots / Lab3_TeaTime_Part4.ino
Last active October 16, 2017 15:03
Lab3_TeaTime_Part4
// TEA TIME!
// Libraries for the DS18B20 Temperature Sensor
#include <OneWire.h>
#include <DallasTemperature.h>
// PINS--------------------------------------
// One-Wire Temperature Sensor
#define ONE_WIRE_BUS 2 // Blue Stripe is data