OP90.180_ITR9606.ino 471 B

1234567891011121314151617181920212223242526
  1. /*
  2. Description: Detect the current OP 90/180 Unit Photoelectric switch status.
  3. */
  4. #include <M5Stack.h>
  5. void setup() {
  6. // put your setup code here, to run once:
  7. M5.begin();
  8. M5.Power.begin();
  9. //Wire.begin();
  10. M5.Lcd.setCursor(120, 10, 4);
  11. M5.Lcd.println("90/180 OPTICAL");
  12. pinMode(36,INPUT_PULLUP);
  13. }
  14. void loop() {
  15. // put your main code here, to run repeatedly:
  16. M5.Lcd.setCursor(80, 120, 4);
  17. M5.Lcd.printf("ir receive: %d",digitalRead(36));
  18. }