PORT command in Basic
Posted: Sat May 30, 2020 12:48 pm
I want to ask a question about the Basic command, PORT. I would like to read a 12-bit input on my EzSBC1 and print the result as a number. If I understand this command, I can set 12 pins to inputs (P0.0 to P0.11, say), execute x = PORT(0), and then AND the result with some appropriate number to get my result, yes? Only my attempts to do this result in odd results. Not the least of which is the number is a huge floating-point number.
The text in the Basic manual is, well, hard to comprehend. Not least is the difference in nomenclature. For example, what pin on the board is represented by P1.0 or P1.31? These don’t seem to correspond to board pins.
Can you enlighten me? How would I read 12 input pins as a ‘port’?
The text in the Basic manual is, well, hard to comprehend. Not least is the difference in nomenclature. For example, what pin on the board is represented by P1.0 or P1.31? These don’t seem to correspond to board pins.
Can you enlighten me? How would I read 12 input pins as a ‘port’?