Last active
August 29, 2015 13:57
-
-
Save lengstrom/9713534 to your computer and use it in GitHub Desktop.
Reading digital inputs off of a HiTechnic Superpro Prototype Sensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma config(Sensor, S1, HTSPB, sensorI2CCustom9V) | |
///Requires Xander's drivers | |
#include "drivers/hitechnic-superpro.h" | |
task main() { | |
HTSPBsetupIO(HTSPB, 0x3F); | |
while(true) { | |
nxtDisplayTextLine(1, "B0: %d", HTSPBreadIO(HTSPB, 0x00)); | |
nxtDisplayTextLine(2, "B1: %d", HTSPBreadIO(HTSPB, 0x01)); | |
nxtDisplayTextLine(3, "B2: %d", HTSPBreadIO(HTSPB, 0x02)); | |
nxtDisplayTextLine(4, "B3: %d", HTSPBreadIO(HTSPB, 0x03)); | |
// nxtDisplayTextLine(5, "%d", HTSPBreadIO(HTSPB, 0x04)); | |
// nxtDisplayTextLine(6, "%d", HTSPBreadIO(HTSPB, 0x05)); | |
wait1Msec(50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment