原帖由 sacosaco 於 2007-9-6 13:07 發表
請問一下 我利用單晶片 傳輸為9600bps 送01 與80 的資料,之後又送01 與94的資料,可是這樣 我的srf02 並不會動
,不然就是偶爾送出一些資料,請問一下 要如何送資料 srf02才會動,而他送出的結果,要如何去解 ...
Serial Communication
To use the SRF02 in Serial mode, make sure the Mode pin is connected to 0v Ground.
Serial data is fixed at 9600 baud 1 start, 2 stop and no parity bits. Serial data is a TTL level signal - It is NOT RS232. Do not connect the SRF02 to an RS232 port - you will destroy the module! If you would like to connect the SRF02 to your PC's RS232 port, you must use a MAX232 or similar device. It can also be used (in I2C mode) with the USBI2C module to make a self powered USB ranger, see the examples page for details. Many small controllers such as the OOPic, Stamp BS2p, PicAxe etc. as well as a wide variety of micro-controllers have serial ports. To communicate with the SRF02, you simply need to send two bytes, the address of the SRF02 (factory default is 0) and the command. The default shipped address can be changed by the user to any of 16 addresses 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, or 15, therefore up to 16 sonar's can be used.
基本上,SRF02 的預設值應該是0, 也就是說傳送的資料應該是 00、80, 如果需要馬上取出值的話,建議您使用00、83,
關於兩個命令的時間,基本上完全不用延遲也可以取得資料。 |