Permalink
Browse files

.gitignore is now working

  • Loading branch information...
1 parent 963ce9e commit a88833a3f0875ba7743f5e1d6ffdfca5a2aee5c4 @ottodude125 committed Feb 24, 2012
View
17 .svn/all-wcprops
@@ -1,17 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 22
-/svn/!svn/ver/19/trunk
-END
-Has_Orange_and_Yellow_Working.pde
-K 25
-svn:wc:ra_dav:version-url
-V 56
-/svn/!svn/ver/18/trunk/Has_Orange_and_Yellow_Working.pde
-END
-README.txt
-K 25
-svn:wc:ra_dav:version-url
-V 33
-/svn/!svn/ver/21/trunk/README.txt
-END
View
105 .svn/entries
@@ -1,105 +0,0 @@
-10
-
-dir
-19
-https://emma-5-navigation.googlecode.com/svn/trunk
-https://emma-5-navigation.googlecode.com/svn
-
-
-
-2012-02-07T19:03:13.998866Z
-19
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-012973a8-93a4-64ee-d692-0806c915260c
-
-.git
-dir
-
-NavControl
-dir
-
-Has_Orange_and_Yellow_Working.pde
-file
-
-
-
-
-2012-02-07T18:59:02.000000Z
-d4e8736e4fb8a2896bc74c42f02f4187
-2012-02-07T18:59:12.346214Z
-18
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-6335
-
-README.txt
-file
-21
-
-
-
-2012-02-09T01:06:35.000000Z
-7c93d2cfa97ccd950a0b324b7db27e2e
-2012-02-24T02:57:01.888704Z
-21
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-807
-
-Unused Code
-dir
-
View
275 .svn/text-base/Has_Orange_and_Yellow_Working.pde.svn-base
@@ -1,275 +0,0 @@
-//For now and now get rid of summing and averages, get it to work with just what is going on now, and then move into arrays
-
-
-// accelerometer part # A7260
-// K911014
-// Yellow and Purple wire need to both input 00 into the accelerometer. yellow wire is in arduino pin #22, purple is in #23
-//x output is blue wire arduino pin 13, y output is orange wire arduino pin 14, z output is red wire arduino pin 15.
-
-#define maxCurb 0.1016 //max height of scalable curb
-
-#include <math.h>
-
-//definitions
-#define angle 0.972412853719443 //1.2065 meters is bottom of triangle 0.56515 is side
-#define sensorElev 0.5842 //.186182 meters
-
-//ultrasonic
-#define bw 24
-#define rx 25
-#define aAN 0
-#define bAN 1
-
-//accelerometer
-#define gs1 22
-#define gs2 23
-#define xPin 13
-#define yPin 14
-#define zPin 15
-#define offset 1690
-
-// mV/g for each axis
-#define sz 830
-#define sx 850
-#define sy 680
-
-#define g 9.81
-#define numSampls 50 //Trying a lower number, original was 100
-
-#define slowVal 1.1144
-#define stopVal 0.5064
-#define slowValu 0.1524
-#define stopValu 0.0508
-
-#define inclineLimit 2 //max incline
-#define declineLimit 2 //max decline
-
-//pins for testing, will be replaced by writes to the bus
-#define testSlow 51
-#define testStop 48
-#define testGo 50
-
-
-//global variables
-int SumX, SumY, SumZ, Xavg, Yavg, Zavg;
-//float Xavg, Yavg, Zavg, aX, aY, aZ, vX, vY, vZ, pvX, pvY, pvZ, cpY, tElev, tDist;
-float aX, aY, aZ, vX, vY, vZ, pvX, pvY, pvZ, cpY, tElev, tDist;
-unsigned long dt, prevTime;
-int yPs[10];
-int tEs[10];
-int aVal = 0; //The value read from pin A0
-//int bVal = 0; //The value read for pin A2
-int aSum = 0; //Sum of the read values of a
-//int bSum = 0; //Sum of the read values of b
-//float bAvg = 0; //Average of the sums of b
-float aAvg = 0;
-float sensorInput;
-float slope;
-
-//setup
-void setup(){
-
- Serial.begin(9600);
-
- //testing
- pinMode(testSlow, OUTPUT);
- pinMode(testStop, OUTPUT);
- pinMode(testGo, OUTPUT);
-
-
- //pinMode(gs1, OUTPUT);
- //pinMode(gs2, OUTPUT);
-
- pinMode(bw, OUTPUT);
- pinMode(rx, OUTPUT);
-
-
- //analog inputs
- pinMode(aAN, INPUT);
- pinMode(bAN, INPUT);
-
- //hold BW HIGH
- digitalWrite(bw, HIGH);
-
-
- //start sensors
- digitalWrite(rx, HIGH);
- //hold RX high for 20-50 microseconds
- delayMicroseconds(20);
- pinMode(rx, INPUT); //return to "HIGH IMPEDANCE STATE"
-
-
- //digitalWrite(gs1, LOW);
- //digitalWrite(gs2, LOW);
- Serial.begin(9600);
-}
-
-
-void loop(){
-
-
- //it would probably be better to alternate an accelerometer and ultrasonic reads
-
-
- //get brief average of accelerometer reads
- SumX = 0;
- SumY = 0;
- SumZ = 0;
-
- analogReference(EXTERNAL);
- //Serial.println(xPin);
- //Serial.println(yPin);
- //Serial.println(zPin);
-
- for(int i=0; i<numSampls; i++){
- SumX = SumX + analogRead(xPin);
- SumY = SumY + analogRead(yPin);
- SumZ = SumZ + analogRead(zPin);
- Serial.println(SumX);
- Serial.println(SumY);
- Serial.println(SumZ);
- }
-
- Xavg = SumX/numSampls;
- Yavg = SumY/numSampls;
- Zavg = SumZ/numSampls;
- //Serial.println("x value is" + Xavg);
- //Serial.println("y value is" + Yavg);
- //Serial.println("z value is" + Zavg);
-
- aX = (((Xavg * 3.301)-offset)/sx)*g;
- aY = (((Yavg * 3.301)-offset)/sy)*g;
- aZ = (((Zavg * 3.301)-offset)/sz)*g;
-
- dt = micros()-prevTime;
-
- vX = pvX + aX*dt; //velocity
-
- cpY = yPs[0] + .5*aY*dt*dt; //position
-
- //an array of previous positions. should be a for loop with a definition indicating the length of the array
- yPs[9] = yPs[8];
- yPs[8] = yPs[7];
- yPs[7] = yPs[6];
- yPs[6] = yPs[5];
- yPs[5] = yPs[4];
- yPs[4] = yPs[3];
- yPs[3] = yPs[2];
- yPs[2] = yPs[1];
- yPs[1] = yPs[0];
- yPs[0] = cpY;
-
- prevTime = prevTime + dt;
-
-
-
-
- //get distance sensor input
-
- aSum = 0;
- //bSum = 0;
-
- analogReference(DEFAULT);
- //The loop sums up 100 values read from the sensors
- for (int i=0; i<numSampls; i++) {
- aSum = aSum + analogRead(aAN); //Get sensor read and convert the values into meters
- //bSum = bSum + analogRead(bAN);
- }
-
- //Average the sums of the values. The for loop and this step together provide a
- //more precise reading of the distance.
- aAvg = aSum / numSampls;
- //bAvg = bSum / numSampls;
- sensorInput = aAvg/*+bAvg)/2*/ * 0.01295;
-
-
-
- //testing
- Serial.print("sensor input ");
- Serial.println(sensorInput);
-
- tElev = sensorElev - cos(angle)*sensorInput;
-
- //testing
- Serial.print("Elevation is ");
- Serial.println(tElev);
-
- //array of target elevations
- /*tEs[9] = tEs[8];
- tEs[8] = tEs[7];
- tEs[7] = tEs[6];
- tEs[6] = tEs[5];
- tEs[5] = tEs[4];
- tEs[4] = tEs[3];
- tEs[3] = tEs[2];
- tEs[2] = tEs[1];
- tEs[1] = tEs[0];
- tEs[0] = tElev;*/
-
-
- tDist = sin(angle)*sensorInput;
-
- //testing
- Serial.print("Distance is ");
- Serial.println(tDist);
- Serial.println("");
-
-
-
- if (tDist <= slowVal && tDist > stopVal) {
- digitalWrite(testSlow, HIGH);
- //delay(500);
- //digitalWrite(testSlow, LOW);
-
- }
- if (tDist > slowVal && tDist > stopVal) {
- digitalWrite(testSlow, LOW);
- }
-
-
- if (tDist <= stopVal) {
- digitalWrite(testStop, HIGH);
- // delay(500);
- //digitalWrite(testStop, LOW);
- digitalWrite(testSlow, LOW);
- }
- if (tDist > stopVal) {
- digitalWrite(testStop, LOW);
- }
-
- //at the moment, it just uses the extremes (oldest and newest) of it's stored data to calculate the slope, there is a better way to do this
- slope = (tEs[9]-tEs[0])/(yPs[9]-yPs[0]);
-
- //if(slope>inclineLimit || ((slope*-1)>declineLimit) )}
- //^uphill too much //^downhill too much
-
-
- //check to see if the height is scalable
- if(tElev<maxCurb){
- //scaleable
- //drive
-
- //testing for now
- digitalWrite(testGo, LOW);
- //delay(500);
- //igitalWrite(testGo, LOW);
- }
-
- //else{
- if(tElev>=maxCurb){
- //not scaleable
- //stop the robot
- digitalWrite(testGo, HIGH);
-
- //testing
- //digitalWrite(testStop, HIGH);
- //delay(500);
- //digitalWrite(testStop, LOW);
-
- }
- }
-
- //testing
- //delay(1000);
-//}
-
View
41 NavControl/.svn/all-wcprops
@@ -1,41 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 33
-/svn/!svn/ver/19/trunk/NavControl
-END
-DriveControl.h
-K 25
-svn:wc:ra_dav:version-url
-V 48
-/svn/!svn/ver/20/trunk/NavControl/DriveControl.h
-END
-UltrasonicSensors.cpp
-K 25
-svn:wc:ra_dav:version-url
-V 55
-/svn/!svn/ver/20/trunk/NavControl/UltrasonicSensors.cpp
-END
-defines.h
-K 25
-svn:wc:ra_dav:version-url
-V 43
-/svn/!svn/ver/20/trunk/NavControl/defines.h
-END
-ultraSonic.h
-K 25
-svn:wc:ra_dav:version-url
-V 46
-/svn/!svn/ver/20/trunk/NavControl/ultraSonic.h
-END
-NavControl.ino
-K 25
-svn:wc:ra_dav:version-url
-V 48
-/svn/!svn/ver/20/trunk/NavControl/NavControl.ino
-END
-DriveControl.cpp
-K 25
-svn:wc:ra_dav:version-url
-V 50
-/svn/!svn/ver/20/trunk/NavControl/DriveControl.cpp
-END
View
328 NavControl/.svn/entries
@@ -1,328 +0,0 @@
-10
-
-dir
-19
-https://emma-5-navigation.googlecode.com/svn/trunk/NavControl
-https://emma-5-navigation.googlecode.com/svn
-
-
-
-2012-02-07T19:03:13.998866Z
-19
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-012973a8-93a4-64ee-d692-0806c915260c
-
-DriveControl.h
-file
-20
-
-
-
-2012-02-24T02:48:49.000000Z
-9d77b71626aa43f39603e23f09751b61
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1472
-
-UltrasonicSensors.cpp
-file
-20
-
-
-
-2012-02-24T02:48:49.000000Z
-7170f7e5e3b2f2bc196a7fdbbb8009dd
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1602
-
-defines.h
-file
-20
-
-
-
-2012-02-24T02:48:49.000000Z
-a655e17430a7f99568ee1eb9e2b924af
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2234
-
-ProjectResources.ino
-file
-20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-deleted
-
-IRSensor.ino
-file
-20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-deleted
-
-NavControl.ino
-file
-20
-
-
-
-2012-02-24T02:48:42.000000Z
-5659c0d474a830dba6e89dfc841c8773
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5907
-
-ultraSonic.h
-file
-20
-
-
-
-2012-02-24T02:48:49.000000Z
-01e6069fd22eddfc18ae53cc0a044e27
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-821
-
-LasSemestersCode.ino
-file
-20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-deleted
-
-DriveControl.cpp
-file
-20
-
-
-
-2012-02-24T02:48:49.000000Z
-2cd6f12482a2640c868e9ff143722107
-2012-02-24T02:55:20.732656Z
-20
-jkaton125
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3519
-
-Accelerometer.ino
-file
-20
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-deleted
-
View
123 NavControl/.svn/text-base/DriveControl.cpp.svn-base
@@ -1,123 +0,0 @@
-/*
-* Created 2/1/11
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-*
-* The DriveControl is responsible for:
-* 1) Analyze the previous data obtained from the USS Sensors
-* 2) Determine if the interup lines should be set to High if normal operation or Low for take action
-* 3) Set data lines high or low based on needs
-*/
-
-
-#include "DriveControl.h"
-
-
-// Constructor
-DriveControl::DriveControl(int driveCtrlPins[])
-{
- digitalPin0 = driveCtrlPins[0]; // InteruptL
- digitalPin1 = driveCtrlPins[1]; // InteruptR
- digitalPin2 = driveCtrlPins[2]; // dataL0
- digitalPin3 = driveCtrlPins[3]; // dataL1
- digitalPin4 = driveCtrlPins[4]; // dataR0
- digitalPin5 = driveCtrlPins[5]; // dataR1
-}
-
-// initialize the interupts to high and data bytes to low
-void DriveControl::initializePins()
-{
- // Set InteruptL HIGH
- digitalWrite(digitalPin0, HIGH);
- // Set InteruptR HIGH
- digitalWrite(digitalPin1, HIGH);
-
- // set all drive control data pins to LOW
- digitalWrite(digitalPin2, LOW);
- digitalWrite(digitalPin3, LOW);
- digitalWrite(digitalPin4, LOW);
- digitalWrite(digitalPin5, LOW);
-
-}
-
-// Update the values on each interupt pin based on decision from processSensors
-// If it is a 1 then set pin to high and if it is 0 set the pin to low
-void DriveControl::setInteruptPinValues()
-{
- // if interuptL is set to 1 keep the pin high
- if(pinStatus[0] == 1)
- digitalWrite(digitalPin0, HIGH);
- // otherwise set it to low indicating action should be taken
- else
- digitalWrite(digitalPin0, LOW);
-
- // if interuptR is set to 1 keep the pin high
- if(pinStatus[1] == 1)
- digitalWrite(digitalPin1, HIGH);
- // otherwise set it to low indicating action should be taken
- else
- digitalWrite(digitalPin1, LOW);
-
- // if dataL0 is set to 1 set the pin high
- if(pinStatus[2] == 1)
- digitalWrite(digitalPin2, HIGH);
- // otherwise keep it low
- else
- digitalWrite(digitalPin2, LOW);
-
- // if dataL1 is set to 1 set the pin high
- if(pinStatus[3] == 1)
- digitalWrite(digitalPin3, HIGH);
- // otherwise keep it low
- else
- digitalWrite(digitalPin3, LOW);
-
- // if dataR0 is set to 1 set the pin high
- if(pinStatus[4] == 1)
- digitalWrite(digitalPin4, HIGH);
- // otherwise keep it low
- else
- digitalWrite(digitalPin4, LOW);
-
- // if dataR1 is set to 1 set the pin high
- if(pinStatus[5] == 1)
- digitalWrite(digitalPin5, HIGH);
- // otherwise keep it low
- else
- digitalWrite(digitalPin5, LOW);
-
-
-}
-
-// process the ultrasonic sensors and determine what the new interupt values should be set to
-void DriveControl::processNewDistances(float left[2][numUssDistances], float right[2][numUssDistances], float front[2][numUssDistances], float back[2][numUssDistances])
-{
- float distances[8][numUssDistances];
- //populate array with distanceinformation
- /*distance[0][0] =
- distance[1][0] =
- distance[2][0] =
- distance[3][0] =
- distance[4][0] =
- distance[5][0] = ill get to this...
- distance[6][0] =
- distance[7][0] =*/
-
-}
-
-// reset the drive control system
-void DriveControl::resetDriveControl( int driveCtrlPins[])
-{
- // Set InteruptL HIGH
- digitalWrite(digitalPin0, HIGH);
- // Set InteruptR HIGH
- digitalWrite(digitalPin1, HIGH);
-
- // set all drive control data pins to LOW
- digitalWrite(digitalPin2, LOW);
- digitalWrite(digitalPin3, LOW);
- digitalWrite(digitalPin4, LOW);
- digitalWrite(digitalPin5, LOW);
-
-}
View
51 NavControl/.svn/text-base/DriveControl.h.svn-base
@@ -1,51 +0,0 @@
-/*
-* Created 2/1/11
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-*
-* The DriveControl is responsible for:
-* 1) Analyze the previous data obtained from the USS Sensors
-* 2) Determine if the interup lines should be set to High if normal operation or Low for take action
-* 3) Set data lines high or low based on needs
-*/
-
-
-#ifndef DriveControl_h
-#define DriveControl_h
-
-#include "Arduino.h"
-#include "defines.h"
-
-
-class DriveControl
-{
- public:
- // constructor
- DriveControl( int driveCtrlPins[6]);
-
- void initializePins(); // initialize the values set on interupt/data pins
-
- void setInteruptPinValues(); // update values set on the interupt/data pins
-
- void resetDriveControl( int driveOutPins[6]); // reset the interupt/data pin values
-
- // process most recent values obtaine from ultrasonic sensors and decide what the interupt/data line values should be updated to
- void processNewDistances(float left[2][numUssDistances], float right[2][numUssDistances], float front[2][numUssDistances], float back[2][numUssDistances]);
-
-
- // pin numbers mapping to the arduino board for all the interupt pins used
- private:
- int digitalPin0;
- int digitalPin1;
- int digitalPin2;
- int digitalPin3;
- int digitalPin4;
- int digitalPin5;
- int pinStatus[6]; // value to be place on pin 0 = LOW, 1 = HIGH
-
-
-};
-
-#endif
-
View
191 NavControl/.svn/text-base/NavControl.ino.svn-base
@@ -1,191 +0,0 @@
-/*
-* Created 1/26/11
-*
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-* With additional assistance on network comminication by
-* * Mathew Comeau
-* * Thomas Pavlu
-*
-* NavControl is the control center for managing the navigation system of Emma.
-* It will be in charge of:
-* * Initialize all navigation systems
-* * Obtain current distance values from:
-* * IR Sensors
-* * A precise measuring device to detect the distance of an obstacle
-* * 4 sensors - Two facing forward and two facing rear
-* * Placed horizontally on the lower corners of robot
-* * Ultrasonic Wave Sensors
-* * A secondary measuring device to measure distances obstacles
-* * 20 sensors total
-* * 3 on each side facing at a downward angle to detect changes in terrain ( stairs (up or down), curb, cliff, etc)
-* * 2 on each side placed horizontally to detect large obstacles ( wall, desk, chair, Professor Soules, etc)
-* * Accelerometer
-* * Function to be later determined
-* * Process obstacle data and determine if drive system needs to be stopped to avoid accident
-* * Notify drive control of what action to take
-*/
-
-
-#include "Arduino.h"
-#include "defines.h"
-#include "ultraSonic.h"
-#include "DriveControl.h"
-
-
-/**
-* Array to hold IR sensor pin #'s
-*/
-const int irPins[numIRSensors] = {irSensorPinFL,
- irSensorPinFR,
- irSensorPinRL,
- irSensorPinRR};
-
-/**
-* Array of Two Most Recent IR Distance Values (FL,FR,RL,RR) <--- order of sensors in array
-*/
-float irDistances[numIRSensors][numIRDistances];
-
-/**
-* Array to hold Ultra Sonic sensor pin #'s
-*/
-const int ussPins[numUssSensors] = {ussPin0,
- ussPin1,
- ussPin2,
- ussPin3,
- ussPin4,
- ussPin5,
- ussPin6,
- ussPin7};
-
-//make 4 instances of ultrasonic class
-//analog pins are set up as follows
-//front: right = 0 left = 1
-//left: front = 2 rear = 3
-//back: left = 4 right = 5
-//right: rear = 6 front = 7
-ultraSonicSensorPair frontPair(0,1);
-ultraSonicSensorPair leftPair(2,3);
-ultraSonicSensorPair backPair(4,5);
-ultraSonicSensorPair rightPair(6,7);
-
-
-/**
-* Array to hold pin #'s which output to drive system
-*/
-int drivePins[6] = {interuptL,
- interuptR,
- dataL0,
- dataL1,
- dataR0,
- dataR1};
-
-// create an instance of DriveControl
-DriveControl drive(drivePins);
-
-// initialize pins, set up ultrasonic sensor loop pairs, set baud rate
-void setup()
-{
- // set these pins as digital outputs
- pinMode(bwPin, OUTPUT);
- pinMode(interuptL, OUTPUT);
- pinMode(interuptR, OUTPUT);
- pinMode(dataL0, OUTPUT);
- pinMode(dataL1, OUTPUT);
- pinMode(dataR0, OUTPUT);
- pinMode(dataR1, OUTPUT);
-
- // Set Ultrasonic Sensors into a Chain
- frontPair.setupUsSensor(rxPinFront, bwPin);
- backPair.setupUsSensor(rxPinBack, bwPin);
- leftPair.setupUsSensor(rxPinLeft, bwPin);
- rightPair.setupUsSensor(rxPinRight, bwPin);
-
- // Initialize Drive Control Hardware Lines
- drive.initializePins();
-
- // this was previously at 9600 baud rate but the bus is running at 19200 so this has been changed
- Serial.begin(19200);
-
-}
-
-void loop()
-{
- // get an updated distance from IR Sensors
- //getIRDistance(irPins, irDistances);
-
- // get current distances from Ultrasonic sensors
- frontPair.getUltrasonicDistance();
- backPair.getUltrasonicDistance();
- leftPair.getUltrasonicDistance();
- rightPair.getUltrasonicDistance();
-
- // process these new distances
- drive.processNewDistances(leftPair.distance, rightPair.distance, frontPair.distance, backPair.distance);
-
- // call driveControl to update instructions to drive system
- drive.setInteruptPinValues();
-
- // print out last distances read
- print();
-
- delay(20);
-}
-
-// Reset navigation system
-void reset()
-{
- // set these pins as digital outputs
- pinMode(bwPin, OUTPUT);
- pinMode(interuptL, OUTPUT);
- pinMode(interuptR, OUTPUT);
- pinMode(dataL0, OUTPUT);
- pinMode(dataL1, OUTPUT);
- pinMode(dataR0, OUTPUT);
- pinMode(dataR1, OUTPUT);
-
- // Set Ultrasonic Sensors into a Chain
- frontPair.setupUsSensor(rxPinFront, bwPin);
- backPair.setupUsSensor(rxPinBack, bwPin);
- leftPair.setupUsSensor(rxPinLeft, bwPin);
- rightPair.setupUsSensor(rxPinRight, bwPin);
-
- // set all drive control pins to low
- drive.resetDriveControl(drivePins);
-}
-
-// Print out distances from all sensors
-void print()
-{
- //cycle through the array of ultrasonic distances
- Serial.print("FRONT(RIGHT: ");
- Serial.print(frontPair.distance[0][0]);//ussDistancesFront[0][0]);
- Serial.print(" LEFT: ");
- Serial.print(frontPair.distance[1][0]);//ussDistancesFront[1][0]);
- Serial.println(") \n");
-
- Serial.print("LEFT(FRONT: ");
- Serial.print(leftPair.distance[0][0]);//ussDistancesLeft[0][0]);
- Serial.print(" REAR: ");
- Serial.print(leftPair.distance[1][0]);//ussDistancesLeft[1][0]);
- Serial.println(") \n");
-
- Serial.print("REAR(LEFT: ");
- Serial.print(backPair.distance[0][0]);//ussDistancesBack[0][0]);
- Serial.print(" RIGHT: ");
- Serial.print(backPair.distance[1][0]);//ussDistancesBack[1][0]);
- Serial.println(") \n");
-
- Serial.print("RIGHT(REAR: ");
- Serial.print(rightPair.distance[0][0]);//ussDistancesRight[0][0]);
- Serial.print(" FRONT: ");
- Serial.print(rightPair.distance[1][0]);//ussDistancesRight[1][0]);
- Serial.println(") \n");
- Serial.println("************************************************** \n");
-
- delay(3000);
-
-}
-
-
View
57 NavControl/.svn/text-base/UltrasonicSensors.cpp.svn-base
@@ -1,57 +0,0 @@
-/*
-* Created 1/25/11
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-*
-* The Ultrasonic Sensor source code obtains the latest distance readings from
-* given sensors and writes it into the most recent array location
-*/
-
-
-#include "ultraSonic.h"
-
-
-// Constructor
-ultraSonicSensorPair::ultraSonicSensorPair(int pin1, int pin2)
-{
- //pass in analog pins the sensor pair will be using and set them to variables internal to the class
- analogPin1 = pin1;
- analogPin2 = pin2;
-}
-
-
-// initialize up the sensor loops (each pair of sensors is in a loop so they don't interfere with each others readings)
-void ultraSonicSensorPair::setupUsSensor(int Rx, int Bw)
-{
- // Set BW HIGH
- digitalWrite(Bw, HIGH);
-
- // Start sensors
- digitalWrite(Rx, HIGH);
- // Then hold RX high for 20-50 microseconds
- delayMicroseconds(20);
- // Finally return to "HIGH IMPEDANCE STATE"
- pinMode(Rx, INPUT);
-
-}
-
-// method shifts distance values in array based on age of value and then obtains the current distance
-float ultraSonicSensorPair::getUltrasonicDistance()
-{
- // loop through array to move distances to older location (0-new, numUssDistances-old)
- for(int i = 0; i < numUssDistances-1; i++)
- {
- for (int j = 0; j < 2; j++)
- {
- distance[j][i+1] = distance[j][i];
- }
- }
-
- // add pin i's current distance into first array location
- distance[0][0] = analogRead(analogPin1)*1.27; // factor of 1.27 to convert analog read value into cm
- distance[1][0] = analogRead(analogPin2)*1.27; // factor of 1.27 to convert analog read value into cm
-
-}
-
-
View
53 NavControl/.svn/text-base/defines.h.svn-base
@@ -1,53 +0,0 @@
-/*
-* Created 1/25/11
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-*
-* This header file contains all the project wide defined constants.
-*/
-
-#ifndef defines_h
-#define defines_h
-
-#include "Arduino.h"
-
-
-// Constants specifying pins, number of sensors, and number of samples required for IR Sensors being used
-#define numIRSensors 4 // Specify number of IR Sensors being used
-#define numIRDistances 2 // number of distances to save in array
-#define irSensorPinFL 12 // Front Left
-#define irSensorPinFR 13 // Front Right
-#define irSensorPinRL 14 // Rear Left
-#define irSensorPinRR 15 // Rear Right
-
-// Contants specifying pins for Ultrasonic Sensor Control
-#define rxPinFront 47 // Pin to start sensors
-#define rxPinBack 51 // Pin to start sensors
-#define rxPinLeft 49 // Pin to start sensors
-#define rxPinRight 53 // Pin to start sensors
-#define bwPin 45 // Pin on sensors that will be set to High Constantly
-#define numUssSensors 8 // Specify number of Ultra Sonic Sensors being used
-#define numUssDistances 2 // number of distances to save in array
-#define ussPin0 0 // Sensor 0 analog data iput pin -- FRONT RIGHT
-#define ussPin1 1 // Sensor 1 analog data iput pin -- FRONT LEFT
-#define ussPin2 2 // Sensor 2 analog data iput pin -- LEFT FRONT
-#define ussPin3 3 // Sensor 3 analog data iput pin -- LEFT REAR
-#define ussPin4 4 // Sensor 4 analog data iput pin -- REAR LEFT
-#define ussPin5 5 // Sensor 5 analog data iput pin -- LEFT RIGHT
-#define ussPin6 6 // Sensor 6 analog data iput pin -- RIGHT REAR
-#define ussPin7 7 // Sensor 7 analog data iput pin -- RIGHT FRONT
-
-// pins to serve as direct output to drive control
-#define interuptL 21 // tell drive that something is up and to analyze whats going on based on data0 and data1 if this becomes a zero. It is one otherwise
-#define interuptR 23 // tell drive that something is up and to analyze whats going on based on data0 and data1 if this becomes a zero. It is one otherwise
-// 00 = slow forward, 01 = stop forward, 10 = slow backward, 11 = stop backward
-#define dataL0 25 // Bit # 1 for left motor
-#define dataL1 27 // Bit # 2 for left motor
-#define dataR0 29 // Bit # 1 for right motor
-#define dataR1 31 // Bit # 2 for right motor
-
-
-
-
-#endif
View
39 NavControl/.svn/text-base/ultraSonic.h.svn-base
@@ -1,39 +0,0 @@
-/*
-* Created 1/25/11
-* Developed by and tested by
-* * Jonathan Katon
-* * Mike B.
-*
-* The Ultrasonic Sensor source code obtains the latest distance readings from
-* given sensors and writes it into the most recent array location
-*/
-
-#ifndef ultraSonic_h
-#define ultraSonic_h
-
-#include "Arduino.h"
-#include "defines.h"
-
-
-class ultraSonicSensorPair
-{
- public:
-<<<<<<< HEAD
- // Constructor
- ultraSonicSensorPair(int pin1, int pin2);
-
- // method it initialize the Ultrasonic Sensors and set them cycling
- void setupUsSensor(int Rx, int Bw);
-
- // get current distance
- float getUltrasonicDistance();
-
- // array holding the measured distances from sensors
- float distance[2][numUssDistances];
-
- private:
- int analogPin1;
- int analogPin2;
-};
-
-#endif
View
1 NavControl/ultraSonic.h
@@ -18,7 +18,6 @@
class ultraSonicSensorPair
{
public:
-<<<<<<< HEAD
// Constructor
ultraSonicSensorPair(int pin1, int pin2);

0 comments on commit a88833a

Please sign in to comment.