Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long transistorValue = 0;
- int readingPort = 3;
- void setup() {
- // put your setup code here, to run once:
- pinMode(readingPort, INPUT);
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- //transistorValue = digitalRead(readingPort);
- transistorValue = pulseIn(readingPort, HIGH);
- Serial.print(transistorValue);
- if(transistorValue){
- Serial.print(" hole!");
- }
- else{
- Serial.print(" no hole");
- }
- Serial.println(" ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement