PBASIC to Prop C conversion: DIRH and OUTH
John Kauffman
Posts: 653
I'm having problems finding help on this conversion from PBASIC to Prop C. What are search terms to find info on this?
DIRH %11111111 set high pins (8-15) as outputs
DIRL %00000000 set low pins (0-7) as inputs
Equivalent in Prop C?
OUTH %11111111 set high pins (8-15) to output HIGH
OUTL %00000000 set low pins (0-7) to output LOW
Equivalent in Prop C?
- Thanks
DIRH %11111111 set high pins (8-15) as outputs
DIRL %00000000 set low pins (0-7) as inputs
Equivalent in Prop C?
OUTH %11111111 set high pins (8-15) to output HIGH
OUTL %00000000 set low pins (0-7) to output LOW
Equivalent in Prop C?
- Thanks
Comments
If you're interested in working with a single pin or seeing examples of how to use these registers then there are a number of different options for doing so (propgcc, simpletools, or libpropeller).
Transition for H.S. students & hobbyists from STAMP/PBASIC to PROP/C looks out of reach. A one-liner in PBASIC when converted to Prop C means ten lines of code, including an understanding of bitwise OR and bitwise left shift. That is a pretty big jump.
And if all you want is a single pin then then you can use any of the three links that I posted and do that in one or two lines.
Note that Dave's solution only works on the lower 16 pins (for a match to the BS2 commands). It's easy enough to extend to the upper 16 pins, but you'd have to choose your own names.