Hello this is my program.Now I am using this program for 6 ultrasonic sensor and then this program for pin 9. I don't know how to array for 6 ultrasonic sensor.please help me.thanks!
int ultraSoundpin = 9;
unsigned long ultrasoundDuration = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
// switch pin to output
pinMode(ultraSoundpin0, OUTPUT);
// send a low, wait 2 microseconds, send a high then wait 10 microseconds
digitalWrite(ultraSoundpin0, LOW);
delayMicroseconds(2);
digitalWrite(ultraSoundpin0, HIGH);
delayMicroseconds(10);
digitalWrite(ultraSoundpin0, LOW);
// switch pin to input
pinMode(ultraSoundpin0, INPUT);
// wait for a pulse to come in as high
ultrasoundDuration0 = pulseIn(ultraSoundpin0, HIGH);
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment