IR Remote Control
The handheld remote can send message to Boe-Bot. When a button is pressed, it flashes its IR LED on/off at 38.5KHZ to broadcast code which is produced by controlling the brief amounts of time the IR LED flashes on and off.
手持遙控器可以向Boe機(jī)器人發(fā)送信息镰吵。當(dāng)按下按鈕時安拟,其IR LED以38.5KHZ的頻率閃爍,以廣播通過控制IR LED閃爍的短暫時間產(chǎn)生的代碼
遙控器發(fā)出紅外,控制 IR (紅外接收器)閃爍闽撤,然后產(chǎn)生控制
Press the button from the Sony Controller, its broadcast IR message starts for 2.4ms signal, and follows consists of a combination of 1.2ms(binary-1) and 0.6ms(binary-0) broadcast.
按下索尼控制器上的按鈕孩哑,它的廣播紅外信息將以2.4ms的信號開始甚淡,然后由1.2ms(二進(jìn)制-1)和0.6ms(二進(jìn)制-0)的廣播組合組成坦袍。
Detector sends a LOW signal whenever it detects IR flashing on/off at 38.5kHz and a HIGH signal the rest of the time.
When IR detector sends low signal, the Basic Stamp 2 can measurement how long each of the low signal lasts, then figure out which key was pressed on the remote.
如果按住遙控器上的一個鍵嚷炉,同一條信息將被反復(fù)發(fā)送化撕,兩條信息之間的間隔時間為20到30毫秒
Circuit
PULSIN Pin, State, Variable
PULSIN 9,1,time (unit of time is 2us)
紅外遙控器發(fā)送的紅外信息包含12個數(shù)據(jù)脈沖帆竹。我們使用數(shù)組變量來存儲消息屁柏。
Time VAR word(12)
The Ultrasonic Ping Sensor
超聲波傳感器
- 作用: Measure how far away an object is from the sensor
- Range: 3cms to 3.3m
-
Highly Accurate精確: to within 1 or 2 cm
- Ping sends a HIGH signal to BasicStamp & send a 40Khz sound towards the object
- Ping receives an echo, sends a LOW to BasicStamp
- BasicStamp stores the time between HIGH and LOW
Through the time to measure distance