- #include <stdio.h>
- #include <propeller.h>
- #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){
- pinHigh(16);
- waitcnt(CLKFREQ/10+CNT);
- pinLow(16);
- }
- else if(Sensor == 1){
- pinHigh(23);
- waitcnt(CLKFREQ/10+CNT);
- pinLow(23);
- }
- }
- return 0;
- }
propeller c sensor
Posted by Anonymous on Wed 5th Sep 2012 02:50
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.