Skip to content

Commit

Permalink
DID EPIC STUFF (REALIZED ARRAYS ARE ALREADY
Browse files Browse the repository at this point in the history
JUST POINTERS TO FIRST INDEX, NOW PASSING buf1 and buf2
TO I2CSEND AND I2CRECEIVE INSTEAD OF &buf1 AND &buf2) TO
FIX MEANINGLESS TESTING ERRORS
  • Loading branch information
kepler452b123 committed Sep 27, 2023
1 parent 3f86538 commit 49d4bfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lm75bd/lm75bd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ error_code_t readTempLM75BD(uint8_t devAddr, float *temp) {
uint8_t buf1[1];
uint8_t buf2[2];
buf1[0] = 0b00000000;
i2cSendTo(devAddr, &buf1 , 1);
i2cReceiveFrom(devAddr, &buf2, 2);
i2cSendTo(devAddr, buf1 , 1);
i2cReceiveFrom(devAddr, buf2, 2);
uint16_t tempReading = 0b0000000000000000;
/* Sets the first 8 bits of tempReading to the MSB in index 0 of buf2 (which stored the temperature data from the sensor)
then shifts the byte 8 to the left so it occupies the first 8 bits
Expand Down

0 comments on commit 49d4bfa

Please sign in to comment.