again cmucam
Archiver
Posts: 46,084
Those who spent time to answer my messages, thank you very much.
I only want to ask this:
1) SERIN and SEROUT commands has an input 'BaudMode'.
2) To establish a 8-bit, No Parity, True Logic serial connection with
Baud Rate of 9600, this Baud Mode value is 84 for BS2. I tried it and
saw that it works with the camera (CMUCam).
3) To establish the same serial connection with BS2p40, BaudMode
value should be 240. But, for some reason (about which I dont have a
clue) it is not working.
I will give the whole program again. Same program works with BS2 but
doesnt work with BS2p40???
Has anyone has an idea?
'
'{$STAMP BS2p}
'{$PBASIC 2.5}
' CMUcam Demo Program 2
RcvData VAR Byte(10)
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"RS", CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"L1 1",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"CR 18 44",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
PAUSE 5000
SEROUT 10, 240, [noparse][[/noparse]"CR 18 44 19 32",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"L1 2",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
PAUSE 5000
SEROUT 10, 240, [noparse][[/noparse]"PM 1",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"RM 3",CR]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"TW",CR]
SERIN 9, 240, [noparse][[/noparse]STR RcvData\8]
DEBUG "Red Mean ",DEC RCVData(2) ,CR
DEBUG "Green Mean ",DEC RCVData(3) ,CR
DEBUG "Blue Mean ",DEC RCVData(4) ,CR
DEBUG "Red Deviation ",DEC RCVData(5) ,CR
DEBUG "Green Deviation ",DEC RCVData(6) ,CR
DEBUG "Blue Deviation ",DEC RCVData(7) ,CR
DEBUG " ", CR
PAUSE 2000
Main:
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"TC",CR]
SERIN 9, 240, [noparse][[/noparse]STR RcvData\10]
' Display all returned camera M Track Color packet data to PC debug
screen
DEBUG "Middle Mass X ",DEC RCVData(2) ,CR
DEBUG "Middle Mass Y ",DEC RCVData(3) ,CR
DEBUG "Left Corner X ",DEC RCVData(4) ,CR
DEBUG "Left Corner Y ",DEC RCVData(5) ,CR
DEBUG "Right corner X ",DEC RCVData(6) ,CR
DEBUG "Right Corner Y ",DEC RCVData(7) ,CR
DEBUG "Pixels ",DEC RCVData(8) ,CR
DEBUG "Confidence ",DEC RCVData(9) ,CR
DEBUG " ", CR
GOTO Main
I only want to ask this:
1) SERIN and SEROUT commands has an input 'BaudMode'.
2) To establish a 8-bit, No Parity, True Logic serial connection with
Baud Rate of 9600, this Baud Mode value is 84 for BS2. I tried it and
saw that it works with the camera (CMUCam).
3) To establish the same serial connection with BS2p40, BaudMode
value should be 240. But, for some reason (about which I dont have a
clue) it is not working.
I will give the whole program again. Same program works with BS2 but
doesnt work with BS2p40???
Has anyone has an idea?
'
'{$STAMP BS2p}
'{$PBASIC 2.5}
' CMUcam Demo Program 2
RcvData VAR Byte(10)
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"RS", CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"L1 1",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"CR 18 44",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
PAUSE 5000
SEROUT 10, 240, [noparse][[/noparse]"CR 18 44 19 32",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"L1 2",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
PAUSE 5000
SEROUT 10, 240, [noparse][[/noparse]"PM 1",CR]
SERIN 9, 240, [noparse][[/noparse]WAIT (":")]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"RM 3",CR]
PAUSE 100
SEROUT 10, 240, [noparse][[/noparse]"TW",CR]
SERIN 9, 240, [noparse][[/noparse]STR RcvData\8]
DEBUG "Red Mean ",DEC RCVData(2) ,CR
DEBUG "Green Mean ",DEC RCVData(3) ,CR
DEBUG "Blue Mean ",DEC RCVData(4) ,CR
DEBUG "Red Deviation ",DEC RCVData(5) ,CR
DEBUG "Green Deviation ",DEC RCVData(6) ,CR
DEBUG "Blue Deviation ",DEC RCVData(7) ,CR
DEBUG " ", CR
PAUSE 2000
Main:
PAUSE 1000
SEROUT 10, 240, [noparse][[/noparse]"TC",CR]
SERIN 9, 240, [noparse][[/noparse]STR RcvData\10]
' Display all returned camera M Track Color packet data to PC debug
screen
DEBUG "Middle Mass X ",DEC RCVData(2) ,CR
DEBUG "Middle Mass Y ",DEC RCVData(3) ,CR
DEBUG "Left Corner X ",DEC RCVData(4) ,CR
DEBUG "Left Corner Y ",DEC RCVData(5) ,CR
DEBUG "Right corner X ",DEC RCVData(6) ,CR
DEBUG "Right Corner Y ",DEC RCVData(7) ,CR
DEBUG "Pixels ",DEC RCVData(8) ,CR
DEBUG "Confidence ",DEC RCVData(9) ,CR
DEBUG " ", CR
GOTO Main