Jump to content
43oh

asus0909

Members
  • Content Count

    3
  • Joined

  • Last visited

About asus0909

  • Rank
    Noob Class

Profile Information

  • Location
    Viet Nam
  1. i don't have... i use I2C_SoftwareLibrary.h http://forum.43oh.com/topic/3617-energia-library-software-i2c-master-for-msp430g2553/ but error error: '__delay_cycles' was not declared in this scope pz,help me?
  2. @@zeke this mean ADD >> GND ? void BH1750_Init(int address) { Wire.beginTransmission(address); Wire.write(0x10);//1lx reolution 120ms Wire.endTransmission(); } Wire.write(0x10);//Continuous_H_resolution_Mode 0x10 Can you help me code sample? p/s:my english is not good
  3. #include <Wire.h> //BH1750 IIC Mode #include <math.h> int BH1750address = 0x23; //setting i2c address uint16_t val=0; byte buff[2]; void setup() { Wire.begin(); Serial.begin(9600);//init Serail band rate } void loop() { int i; val=0; BH1750_Init(BH1750address); delay(200); if(2==BH1750_Read(BH1750address)) { val=((buff[0]<<8)|buff[1])/1.2; Serial.print(val,DEC); Serial.println("[lx]"); } } int BH1750_Read(int address) { int i=0; Wire.beginTransmission(address); Wire.requestFrom(address, 2 ); while(Wire.available())
×
×
  • Create New...