AiStarter User Guide 7API Function
IssueV1.0.3(2018-09-01) AiStarter User Guide Copyright © Yuejiang Technology Co., Ltd
31
7.7 Initializing Ultrasonic Sensor
Table 7.5 Initialize ultrasonic sensor
int AIStarter_SmartBotSetSonar (int port)
Initialize ultrasonic sensor
port: Select ultrasonic sensor
enum {
SONAR1,
SONAR2,
SONAR3
};
7.8 Getting the Detection Distance of Ultrasonic Sensor
Table 7.6 Get the detection distance of ultrasonic sensor
float AIStarter_SmartBotGetSonar (int port)
Get the detection distance of ultrasonic sensor
port: Select ultrasonic sensor
enum {
SONAR1,
SONAR2,
SONAR3
};
Return detection distance (Unit: cm)
7.9 Detecting obstacle
Table 7.7 Detect obstacle
bool AIStarter_SmartBotGetBarrier (int port)