Shiftout question
I am not very familiar with the shiftout command and it appears that I am going to have to use it for this small project.· Could anyone lend me a hand on how the line of code should look to accomplish the following directions.
Timing based on 1/1200 second clock (~.833ms)
Signal is normally high (idle, no IR).
Start: signal goes low for 8/1200 sec.
Data bits: for each of 8 data bits, space encoded signal depending on bit value
··· Sends the most significant data bit first
··· If the data bit is 0: signal goes high for 1/1200 sec, and low for 1/1200 sec.
··· If the data bit is 1: signal goes high for 4/1200 sec, and low for 1/1200 sec.
··· BTW: The first bit (msb) is always 1 (valid codes are from $80 to $FF)
When completed, signal goes high again.
No explicit stop bit. Minimal between signals is not known.
Timing based on 1/1200 second clock (~.833ms)
Signal is normally high (idle, no IR).
Start: signal goes low for 8/1200 sec.
Data bits: for each of 8 data bits, space encoded signal depending on bit value
··· Sends the most significant data bit first
··· If the data bit is 0: signal goes high for 1/1200 sec, and low for 1/1200 sec.
··· If the data bit is 1: signal goes high for 4/1200 sec, and low for 1/1200 sec.
··· BTW: The first bit (msb) is always 1 (valid codes are from $80 to $FF)
When completed, signal goes high again.
No explicit stop bit. Minimal between signals is not known.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Need a bezel for your LCD?
Newzed@aol.com
·
You need to 'send' by using the FREQOUT command.
Note the BS2 only allows you '1 mS' signals, where you need
800 uSec signals.· The BS2sx will send in '400 uS' ticks, so
that's the one you need.
FREQOUT IR_Pin, 16, 38500· ' Send 16 * 400 uS is 6.4 mSec 'start' signal
FREQOUT IR_Pin, 2, 0· ' Send 800 uSec of 'Silence' (IR Detector goes 'high')
FREQOUT IR_Pin, 2, 38000· ' Send 800 uSec of 'Signal'
'*** The above does a start, and sends a 'zero'
FREQOUT IR_Pin, 8, 0· ' Send 8*400 uS == 3.2 mS of 'Silence'
FREQOUT IR_Pin, 2, 38000 ' Send 800 uSec of 'signal'
'**** The above sends a 'one' bit.
Now, to recieve from your RoboSapien, you'll need an IR-Detector module
from Radio Shack.· 3-pins, requires +5, GND, and produces a signal.· The
signal 'floats' high, and is pulled low when the IR-Detector detects the
38500 hz modulated IR-Signal.
You can use 'PULSIN' to read this signal.
·
If I wanted to send $81 to the robosapien following the above instructions, how would I do it. Keep in mind, I am not using infrared to communicate. I am attached to the point on the board where the infrared data comes in.