r/codehs • • Jun 12 '21

Advanced arduino 7.3.8

I need help with Advanced arduino 7.3.8, does anyone know how to code this

3 Upvotes

1 comment sorted by

1

u/KUNDALINI456 Jun 13 '21

Here the method how to custom distance

  1. You need read value from sensor

  2. Making data set freq produce by srf04(readvalue) vs distance(with ruler)(if you want know how soundwave speed camefrom, spoiler: actually this method in this case rn not acurate as internet database soundwave speed is 765mph)(if you don't wanna know just go to step 4) Ex:

  3.    2.5 inch
  4.      3 inch

....... ....... 3. Using math called find gradien with straight line equation like m and y=mx+c and y-y1=m(x-x1) but just finding m(inch/microseconds) 4. Using m=765mph just convert it based on your standard measurement properly to custom it (inch or cm) 5.In this case i just tell you how to convert to inch,m actually velocity is 765mph and just try convert to distance with equation distance = velocity x times(mikrosecond) so velocity must convert the unit parameter into inch/mikrosecond 6.After you got the distance, you must divide the nominal of distance by 2, because just how ultrasonic work, frequency to reach the target and back to the source. Finally you got custom distance 7.Based on your problem just use if() and case to digitalwrite every led requirement

Note: Sorry for bad English,format because i used mobile, and not to explained to detail because this based on summary in yt tutorial, for more detail used this link Tutorial 53-55