#define echoPin 7 // Echo Pin
#define trigPin 8 // Trigger Pin
#define STOP 13 // emergency stop
int maximumRange = 200; // Maximum range needed
int minimumRange = 0; // Minimum range needed
long duration, distance; // Duration used to calculate distance
int stop_counter = 0;
int restar_counter = 0;
void setup() {
Serial.begin (57600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(STOP, OUTPUT);
Therefore, the code on the Arduino Uno that corresponds with the sketch above can be observed below. The code simply reads pin 6 and stops the bogie if the value is HIGH.
int emer = digitalRead(emergency_stop);
if ( emer == HIGH)
{
control_rpm = 0 ;
STOP = true;
}
Currently, I am helping Luis with understanding more of the summer team's code such that we could salvage more pieces of it. Hopefully, we can begin writing in some of our own code and begin testing all the vehicle controls components.
No comments:
Post a Comment