光照模块GY30和arduino通讯
光照模块GY30和arduino通讯无评论2014年5月30日 下午9:58分类:硬件 阅读: 14,192 次
连4根线,VCC、GND、SCL、SDA,SCL、SDA连接arduino的A5、A4脚: 代码: #include <Wire.h> // GY-30 // BH1750FVI // in ADDR 'L' mode 7bit addr #define ADDR 0b0100011 // addr 'H' mode // #define ADDR 0b1011100 void setup() { // put your setup code here, to run once: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } Wire.begin(); pinMode(13, OUTPUT); Wire.beginTra ...
【阅读全文】