#include #include #include "pin.h" int main() { pinInput(2); pinOutput(16); pinOutput(23); while(1) { int Sensor = pinGetField(1,2); waitcnt(CLKFREQ/10+CNT); // printf("\ntest: %d\n\n", Sensor); if (Sensor == 0){ printf("No Movement! :D\n"); pinHigh(16); waitcnt(CLKFREQ/10+CNT); pinLow(16); } else if(Sensor == 1){ printf("OMG MOVEMENT!!!! D;\n"); pinHigh(23); waitcnt(CLKFREQ/10+CNT); pinLow(23); } } return 0; }