Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Delay_us Measuring_pulse_width function in freedom e sdk #448

Open
thisisausername-rgb opened this issue Mar 24, 2020 · 0 comments
Open

Comments

@thisisausername-rgb
Copy link

Hello I am a beginner in sifive board.I am using freedom-metal for ultrasonic ranging.
The following is its arduino code.How to achieve its function with freedom-metal ?
Function:
1.delayMicroseconds(2) //delay 2 us
2.pulseIn(7, HIGH) //Measuring pulse width (us)
float checkdistance_6_7() {
digitalWrite(6, LOW);
delayMicroseconds(2);
digitalWrite(6, HIGH);
delayMicroseconds(10);
digitalWrite(6, LOW);
float distance = pulseIn(7, HIGH) / 58.00;
delay(10);
return distance;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant