BS2pe Question
jamesksu
Posts: 22
Sorry for the complete noob question, and someone may be able to point me to another thread that answers this:
I have a bs2pe that I want to connect (2) daughterboards to. I have a TCS230 color sensor and a PWR-I/O board with a PIR sensor and servo motor attached with 3 pin. Basically I just need help getting started on how I address different devices on the bs2pe using a single program. Everytime I try to run the motor or PIR sensor, any code automatically goes to the color sensor in the "B" socket. Is there a sample code I could grab that shows how to address different devices in socket "a" and "b" in the same program? Is this even possible? Thanks.
I have a bs2pe that I want to connect (2) daughterboards to. I have a TCS230 color sensor and a PWR-I/O board with a PIR sensor and servo motor attached with 3 pin. Basically I just need help getting started on how I address different devices on the bs2pe using a single program. Everytime I try to run the motor or PIR sensor, any code automatically goes to the color sensor in the "B" socket. Is there a sample code I could grab that shows how to address different devices in socket "a" and "b" in the same program? Is this even possible? Thanks.
Comments
Here's a thread that shows a TSL1401-DB and PWR-I/O-DB working together to acquire color images. The BS2pe code is attached below. ('Probably not the best example, since it lacks comments, but you'll get the gist from the pin assignments.)
If you attach your code, it will be easier to provide further assistance if you need it.
-Phil
OWOUT io, 1, [$EC, 128, 8, $00, $EE, exp, $A4]
What do each of the numbers and characters represent in the "outputdata" argument, and what does the comma signify? Again, if there is a place to direct me that will work too.
Thanks.
OTOH, if you wish to use the coprocessor functionality, you can refer to the documents for each different AVR program. The OWOUT parameters you refer to are detailed in the TSL1401-DB's AVR documentation. For the AVR functions that come pre-programmed with the MoBo, refer to the GPIO3 documentation on the MoBo's product page.
-Phil
' =========================================================================
'
' File...... Basic_servo_standard.bs2
' Purpose... Standard rotation servo test code
' Author.... Parallax, Inc.
' E-mail.... support@parallax.com
' Started... 1/3/00
' Updated... 4/29/04
'
' {$STAMP BS2PE}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
' This code will rotate a standard rotation servo in one direction
' and then the other direction.
' Note: The code will work also with the Bs2e and Bs2pe when the directive
' is changed.
'
[ Revision History ]
' 4/29/04 updated to reflect new format changes
'
[ I/O Definitions ]
Servo_pin CON ?? 'I/O pin that is connected to servo
'
[ Variables ]
Temp VAR Word 'Work space for FOR NEXT
'
[ Program Code ]
start:
For temp = 200 To 1200
PULSOUT Servo_pin, temp
PAUSE 50
Next
For temp = 1200 To 200
PULSOUT Servo_pin, temp
PAUSE 50
Next
GoTo start
Oh, and when you post code on the forum...
-Phil