Hello!
I'm having a bit of trouble interfacing the Arduino with the Ultrasonic Sensor from Fichertechnik
https://content.ugfischer.com/cbfiles/fischer/Zulassungen/ft/133009-Ultrasonic-distance-sensor.pdf
Does anyone have any idea of how I could make it work?
This is the code I have so far and what I got from the oscilloscope
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial1.begin(115200, SERIAL_8N1);
//Serial1.begin(2400);
pinMode(2,OUTPUT);
}
char data1 = 'a';
char data2 = 'a';
void loop() {
// put your main code here, to run repeatedly:
//analogWrite(2,153);
//delay(1);
Serial.println("Data: ");
/*
for(int i = 0; i < 1; i++){
digitalWrite(2,HIGH);
delayMicroseconds(100);
digitalWrite(2,LOW);
delayMicroseconds(50);
}
*/
digitalWrite(2,HIGH);
delayMicroseconds(125);
digitalWrite(2,LOW);
delayMicroseconds(78);
//digitalWrite(2,HIGH);
//delayMicroseconds(90);
//digitalWrite(2,LOW);
//Serial1.print('a');
data1 = Serial1.read();
data2 = Serial1.read();
Serial.println(data1,DEC);
Serial.println(data2,DEC);
delay(100);
}


























