1234567891011121314151617181920212223242526 |
- /*
- Description: Detect the current OP 90/180 Unit Photoelectric switch status.
- */
- #include <M5Stack.h>
- void setup() {
- // put your setup code here, to run once:
- M5.begin();
- M5.Power.begin();
- //Wire.begin();
- M5.Lcd.setCursor(120, 10, 4);
- M5.Lcd.println("90/180 OPTICAL");
- pinMode(36,INPUT_PULLUP);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- M5.Lcd.setCursor(80, 120, 4);
- M5.Lcd.printf("ir receive: %d",digitalRead(36));
- }
|