last day (17 days later) » 

4:14 PM
@masterivinchickensheep Come to this room!
@MasterIvinChickenSheep So what is the issue now? It won't start without you turning it?
1
Q: How do I use 2 ultrasonic sensors to control a 5v motor?

Master Ivin ChickenSheepI've hooked up two ultrasonic sensors to my breadboard and I also got a 5v motor installed. I also got the diode installed and the usual set up. I can easily control the motor with one sensor. But what I'm trying to do is I want the motor to run at let's say 100 once I start it up: The first ...

This is a room to discuss this question ^^^
 
5:03 PM
hi
I did the following:
int motorPin = 9;
int trigPin = 13; // Green wire
int echoPin = 12; // White wire
int trigPin2 = 5; // Green wire
int echoPin2 = 4; // White wire
int postdist = 0; // Initial value/ speed of motor

void setup()
{
Serial.begin (9600);
pinMode(trigPin, OUTPUT); // Sensor 1
pinMode(echoPin, INPUT); // Sensor 1
pinMode(trigPin2, OUTPUT); // Sensor 2
pinMode(echoPin2, INPUT); // Sensor 2
pinMode(motorPin, OUTPUT); // Motor
}

void loop()
{
// Sensor 1
int duration, distance;
digitalWrite (trigPin, HIGH);
but it just doesn't do what i want
so basically, the longer you put an object in front of a sensor, the faster or slower (depending on which sensor is being used) the motor spins.
faster up to a speeed of 255 which is considered max. slower up to a speed of 0
 

  last day (17 days later) »