---
# System prepended metadata

title: PIR紅外線人體感測

---

# PIR紅外線人體感測
![](https://hackmd.io/_uploads/B14KP1_gp.png)
```javascript=
boolean __ardublockDigitalRead(int pinNumber)
{
  pinMode(pinNumber, INPUT);
  return digitalRead(pinNumber);
}



void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print(__ardublockDigitalRead(2));
  Serial.print(" ");
  Serial.println();
  delay( 1000 );
}
```