Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: 4 ultrasonic sensor problem on: May 11, 2013, 11:07:38 am
sorry for my english .ı solved my problem.I used this sensor only one . but I need to measure simultaneusly
I use newping library I solve
2  Using Arduino / Programming Questions / 4 ultrasonic sensor problem on: May 11, 2013, 09:13:45 am
Hi everyone ,I have problem with Ultrasonic sensor . I want to use 4 ultrasonic sensor(HC-sr04).I want to measure distance simultaneusly. I m using Arduino Mega 2560..How can I use this sensor? please help me
https://github.com/nazrdogan/TrafficLight/blob/master/TrafficLight/TrafficLight.ino
3  Community / Gigs and Collaborations / line follower robot code? on: December 31, 2012, 09:27:38 am
Hi folks, I need line follower code.  my car sensor have 3*LDR and 2 geared motor. and I have no time for programming.Thanks
4  Topics / Robotics / Re: Servo and Ultrasonic sensor on: October 05, 2012, 06:56:24 pm
thank you for helping me.
 ı will use  this code
Quote
#define trigPin 12
#define echoPin 13
#include <Servo.h>

Servo myservo;
 
void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  myservo.attach(9);
   
}

void loop() {
 int duration, distance,pos=0,i;
  digitalWrite(trigPin, LOW); 
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
   Serial.print(distance);
   Serial.println(" cm");
  if(distance<5)
  {
    myservo.write(180);
  }
  else{
    myservo.write(0);
  }
    
  delay(100);
}

5  Topics / Robotics / Servo and Ultrasonic sensor on: October 04, 2012, 04:43:49 pm
hi, ı will make robot using servo and ultrasonic sensor. then I had write a simple code using servo with sensor.
I want from program if distance under 5 cm servo turning 90 degree. please help me.thank you
where I do wrong?
Code:
#define trigPin 12
#define echoPin 13
#include <Servo.h>

Servo myservo;
 
void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  myservo.attach(9);
  
}

void loop() {
  int duration, distance,pos=0;
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  if (distance<=5){
   myservo.write(90);
    delay(100);
  }
  else {
  
    Serial.print(distance);
    Serial.println(" cm");
  }
  delay(500);
}

Moderator edit: Code tags.
6  Using Arduino / Sensors / Re: MMA7361 accelerometer problem on: March 25, 2012, 01:16:00 pm
thank you very much.. ı will try
7  Using Arduino / Sensors / Re: MMA7361 SimpleAsHell on: March 24, 2012, 04:34:02 pm
thank u . ı will try your code
8  Using Arduino / Sensors / MMA7361 accelerometer problem on: March 24, 2012, 04:02:03 pm
hi everyone..
I have  MMA7361 accelerometer.I try many of code.but I cannot measure acceleration truly. please help me .. can you  give me some example code.

 
 
Pages: [1]