mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
board/stm32f401rc-rs485: Add support to ultrasonic sensor HC-SR04
Signed-off-by: Rodrigo Sim rcsim10@gmail.com
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
e6ed8c6782
commit
8fb458b7fe
@@ -539,3 +539,19 @@ NSH commands::
|
||||
mcsonn_main: Connected
|
||||
|
||||
nsh> msdis
|
||||
|
||||
hcs04
|
||||
-----
|
||||
|
||||
Configures the NuttShell (nsh) over USB Serial (check usbserial configuration) and enables ultrasonic sensor HC-SR04::
|
||||
|
||||
nsh> cat /dev/dist0
|
||||
6241 --> value
|
||||
6227
|
||||
6241
|
||||
6255
|
||||
|
||||
You can convert the value using following::
|
||||
|
||||
Convert to cm: value/58
|
||||
Converto to inches: value/148
|
||||
|
||||
Reference in New Issue
Block a user