Last active
June 24, 2019 05:32
-
-
Save penpencool/f3f3af5abca5690de22a6b7b10d3736c 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
//Example By ArduinoAll | |
#include <Wire.h> | |
#include "i2c.h" | |
#include "i2c_MAX44009.h" | |
MAX44009 lux; | |
// สำหรับอุปกรณ์ GY-49 https://www.arduinoall.com/p/2178 | |
// Arduino Uno GY-49 Example By ArduinoAll | |
// VIN - 3.3V | |
// GND - GND | |
// SCL - A5 | |
// SDA - A4 | |
unsigned long mLux_value; | |
void setup() | |
{ | |
Serial.begin(9600); | |
if (lux.initialize()) Serial.println("Sensor found"); | |
else | |
{ | |
Serial.println("Sensor missing"); | |
while (1) { }; | |
} | |
} | |
void loop() | |
{ | |
lux.getMeasurement(mLux_value); | |
Serial.print("mLUX: "); | |
Serial.print(mLux_value); | |
Serial.println(" "); | |
delay(50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment