What does "one program" mean in this context?Īt the moment i have switched to the i2cmaster-Library from. But putting two values in one programm the wire library seems not to be able to handle it correctly. Well, for one value like temperature, there is no problem. In any case, multiple start conditions are device specific and not part of the SMBus specification (to my knowledge). Maybe your device is very special in this regard and introduced something special or you misinterpreted the start and stop condition to be start and stop bits (that are not bits because the clock line is not alternated). I also used some SMBus devices which also didn't follow your description. I cannot find such a definition in the SMBus description on Wikipedia: The SMBus protocol requires 2 Startbits and then one Stopbit. Int errorcode = Wire.endTransmission(bl03_address) Serial.print("Errorcode=") Serial.println(errorcode) Second=Wire.read() //should get 30 got Bīyte errorcode = Wire.endTransmission(bl03_address) Here is the code for the first attempt (getting voltage and temperature in one sketch): #include "Wire.h" It seems that the values are switched: Getting voltage-values during reading for temperature and vice versa. Now I want to put it in one big sketch and there I get problems I can't explain (see comments). Want to read all the interesting data like voltage, innertemperatur, current,Capacity.Īll these are done in seperated sketches.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |