diff --git a/docs/en/unit/button.md b/docs/en/unit/button.md index 141d6f62..94b673c6 100644 --- a/docs/en/unit/button.md +++ b/docs/en/unit/button.md @@ -24,9 +24,34 @@ The Unit BUTTON is a sigle-button unit that can be detected whether the button p ## Example ```arduino -float tmp = dht12.readTemperature();//temperature -float hum = dht12.readHumidity();//humidity -float pressure = bme.readPressure();//pressure +#include +void setup() { + // init lcd + M5.begin(); + pinMode(36, INPUT); + M5.Lcd.clear(BLACK); + M5.Lcd.setTextColor(YELLOW); + M5.Lcd.setTextSize(2); + M5.Lcd.setCursor(65, 10); + M5.Lcd.println("Button example"); + M5.Lcd.setTextColor(RED); +} + +void loop() { + M5.update(); + + if(digitalRead(36)==0) + { + while(1) + { + if(digitalRead(36)==1) + { + M5.Lcd.print("1"); + break; + } + } + } +} ``` Click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/BUTTON/Arduino)for Specific example. diff --git a/docs/zh_CN/README.md b/docs/zh_CN/README.md index dd632f24..014482c3 100644 --- a/docs/zh_CN/README.md +++ b/docs/zh_CN/README.md @@ -88,8 +88,7 @@ -[![unit_hub.png](https://img-blog.csdnimg.cn/20181211174142806.png)](zh_CN/unit/hub)         [![unit_3.96.png](https://img-blog.csdnimg.cn/20181211174154240.png)](zh_CN/unit/396port) -[![unit_proto.png](https://img-blog.csdnimg.cn/20181211175313832.png)](zh_CN/unit/proto) +[![unit_hub.png](https://img-blog.csdnimg.cn/20181211174142806.png)](zh_CN/unit/hub)         [![unit_396port.png](https://img-blog.csdnimg.cn/20181211174154240.png)](zh_CN/unit/396port)         [![unit_proto.png](https://img-blog.csdnimg.cn/20181211175313832.png)](zh_CN/unit/proto)