Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 5650|回復: 8
打印 上一主題 下一主題

有關srf02 輸了入了2bytes的資料

[複製鏈接]
1#
發表於 2007-9-8 01:00:44 | 顯示全部樓層
原帖由 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,

關於兩個命令的時間,基本上完全不用延遲也可以取得資料。
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-5-10 11:03 , Processed in 0.270431 second(s), 7 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表