SRF10
SRF10 Ultrasonic sensors SRF10 connector description This module used I2C as a protocol to communication with MCU. This module support to use with more than one module in system up to 16 module. We can set ID address for each module before integrated to the system, About how to change ID address click here . For distance to measure this module can measure from 6 cm to 6 m. Sample code: #include <Wire.h> //For Ultrasonic //ADDRESS #define Front_Left 112 #define Front_Right 114 #define CMD 0x00 #define Read_inch 0x50 #define Read_cen 0x51 #define Read_micro_sec 0x52 #define Read_pointer 0x02 void setup() { // put your setup code here, to run once: Serial.begin(115200); Wire.begin(); } void loop() { // put your main code here, to run repeatedly: //Correct Data Serial.println("----"); read_distance_ultrasonic(Front_Left); delay(75); read_distance_ultrasonic(Front_Right); delay(75); } int read_distance_ultrasonic(int addr){ i...
Comments
Post a Comment