Skip to content

Instantly share code, notes, and snippets.

@Bainerd
Bainerd / gist:8038990
Created December 19, 2013 13:22
robotwithmotors2_1e4
/******************************************************************
Author: Luke A. Bain
Date: 11-14-13
Description: obstacle avoidance two sensors and motors
******************************************************************/
#include <SPI.h> // include spi for raspberry pi communication
#include <Servo.h> // include servo to control both steering servo and brushless motors/ESC
#include <NewPing.h> // include for ultrasonic sensor and distance measurement
#include <SoftwareSerial.h> // include for motor controller communication
#define rxPin 5 // not used receive from motor controller
/******************************************************************
Author: Luke A. Bain
Date: 11-14-13
Description: obstacle avoidance two sensors and motors
******************************************************************/
#include <SPI.h> // include spi for raspberry pi communication
#include <Servo.h> // include servo to control both steering servo and brushless motors/ESC
#include <NewPing.h> // include for ultrasonic sensor and distance measurement
#include <SoftwareSerial.h>
#define rxPin 5
@Bainerd
Bainerd / gist:8039063
Created December 19, 2013 13:27
twosensoravoidanceworking
/******************************************************************
Author: Luke A. Bain
Date: 10-28-13
Description: obstacle avoidance two sensors
******************************************************************/
#include <SPI.h> // include spi for raspberry pi communication
#include <Servo.h> // include servo to control both steering servo and brushless motors/ESC
#include <NewPing.h> // include for ultrasonic sensor and distance measurement
#define trigPinFL 8 // Front left sensor send on pin 8
#define echoPinFL 7 // Front left sensor receive on pin 7
@Bainerd
Bainerd / gist:8039080
Created December 19, 2013 13:28
twosensoravoidance
/******************************************************************
Author: Luke A. Bain
Date: 10-12-13
Description: obstacle avoidance two sensors
******************************************************************/
#include <Servo.h>
#include <NewPing.h>
#define trigPinFL 8
#define echoPinFL 7
@Bainerd
Bainerd / gist:8039116
Created December 19, 2013 13:31
pingtoservomotion5
/**********************************
Author: Luke A. Bain
Date: 10-4-13
Description: ping to steer servo
**********************************/
#include <NewPing.h>
#include <Servo.h>
#define trigPin 8;
#define echoPin 7;
@Bainerd
Bainerd / gist:8039150
Created December 19, 2013 13:34
redux1_1
/******************************************************************
Author: Luke A. Bain
Date: 12-1-13
Description: obstacle avoidance two sensors and motors
******************************************************************/
#include <SPI.h> // include spi for raspberry pi communication
#include <Servo.h> // include servo to control both steering servo and brushless motors/ESC
#include <NewPing.h> // include for ultrasonic sensor and distance measurement
#include <SoftwareSerial.h> // include for motor controller communication
#define rxPin 5 // not used receive from motor controller
@Bainerd
Bainerd / gist:8039159
Created December 19, 2013 13:35
array2_1
#define trigPinFL 8 // Front left sensor send on pin 8
#define echoPinFL 7 // Front left sensor receive on pin 7
#define trigPinFR 3 // Front right sensor send on pin 3
#define echoPinFR 4 // Front right sensor receive on pin 4
void setup(){
Serial.begin(9600); // baud rate for serial monitor interface
pinMode (trigPinFL, OUTPUT); // Sets pin 8 as output for FL sensor
pinMode (echoPinFL, INPUT); // sets pin 7 as input for FL sensor
pinMode (trigPinFR, OUTPUT); // sets pin 3 as output for FR sensor
/******************************************************************
Author: Luke A. Bain
Date: 10-3-15
Description: restarting PC application for Arduino
******************************************************************/
int X = 1;
int switchpin =7;
int relaypin = 12;
/**************************************************************************************************
Holgrim control arduino
Written by: Luke A Bain
Scope: Keyboard emulation,button lights and actuation of fan and rumble feature
Version: sudo code
Requirements: arduino Micro or Leonardo
**************************************************************************************************/
#include <Keyboard.h> //for keyboard command to PC
#include <motor.h> //for servo (fan) and rumble motor
void setup(){
/**************************************************************************************************
Holgrim control arduino
Written by: Luke A Bain
Scope: Keyboard emulation,button lights and actuation of fan and rumble feature
Version: sudo code
Requirements: arduino Micro or Leonardo
**************************************************************************************************/
#include <Keyboard.h> //for keyboard command to PC
#include <Servo.h> //for servo (fan) and rumble motor
void setup(){