Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Test Module BH1750 with POP-X2 Board
- // Libarry from https://github.com/claws/BH1750
- #include <popx2.h>
- #include <BH1750.h>
- long L;
- BH1750 Lux;
- void setup(){
- Wire.begin();
- Lux.begin();
- setTextSize(2);glcdMode(3);
- setTextColor(GLCD_YELLOW);glcd(0,0,"BH1750");
- setTextColor(GLCD_SKY); glcd(0,7,"Test");
- glcdFillRect(0,64,80,64,GLCD_WHITE);
- }
- void loop() {
- L = Lux.readLightLevel();
- setTextColor(GLCD_GREEN); glcd(2,0,"Light");
- setTextColor(GLCD_VIOLET); glcd(2,6,"%l lx ",L);
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment