سلام داداش
شما اول ماژول خودتو مشخص کن با چی میخوای کار کنی ؟!
مثلا من با SRF02 بیشتر کار میکنم که خروجی i2c & serial هست
اینم نمونه برنامه
$regfile = "m32def.dat"
$crystal = 800000
Config Lcdpin = Pin , Rs = Porta.0 , E = Portb.1 , Db4 = Portb.2 ,_
Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5
Config Lcd = 16 * 2
Config Sda = Portc.0
Config Scl = Portc.1
Dim X As Integer , Y As Integer , Z As Word
Cursor Off
Do
I2cstart
I2cwbyte &HE0
I2cwbyte &H00
I2cwbyte &H51
I2cstop
I2cstart
I2cwbyte &HE0
I2cwbyte &H02
I2creceive &HE0 , X
I2cstop
I2cstart
I2cwbyte &H03
I2creceive &HE0 , Y
I2cstop
Cls
Z = X * 256
Z = Z + Y
Waitms 200
Lcd Z
Waitms 800
Loop