Skip to content

Instantly share code, notes, and snippets.

@lengstrom
Last active August 29, 2015 13:57
Show Gist options
  • Save lengstrom/9713534 to your computer and use it in GitHub Desktop.
Save lengstrom/9713534 to your computer and use it in GitHub Desktop.
Reading digital inputs off of a HiTechnic Superpro Prototype Sensor
#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