Created
November 20, 2019 14:47
-
-
Save takahashim/29a83f6f0fe873229493bc90012565a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/yamanekko/M5StickC-IDF-m5mruby | |
# https://github.com/yamanekko/mruby-m5stickc | |
Wire = M5StickC::TwoWire.new(0) | |
Wire.begin(32, 33, 100000) | |
LCD = M5StickC::Display.new | |
LCD.rotation = 1 | |
LCD.clear | |
LCD.fill_screen(M5StickC::Display::BLACK) | |
LCD.text_color = M5StickC::Display::WHITE | |
LCD.text_font = 2 | |
ESP32::System.delay(1000) | |
@bmp = M5StickC::BMP280.new | |
@bmp.begin | |
@dht = M5StickC::DHT12.new | |
while true | |
ESP32::System.delay(1000) | |
LCD.clear | |
LCD.cursor(1, 0) | |
LCD.printf "RubyConf2019 Nashville\n" | |
LCD.printf "Pressure: %.2f\n", @bmp.read_pressure | |
LCD.printf "Temperature: %.2f\n", @dht.read_temperature | |
LCD.printf "Humidity: %.2f\n", @dht.read_humidity | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment