Skip to content

Commit

Permalink
Fix Raspi Pic formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
psachs committed Dec 18, 2023
1 parent aa01802 commit 896ff77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions sample-implementations/RaspberryPi_Pico/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static int addr = 0x62;
// I2C Pins
static uint sda_pin = 16;
static uint scl_pin = 17;


// This is the main entry for your c application. U
// is
Expand Down Expand Up @@ -50,14 +49,15 @@ int main() {

while (1) {

// Check if data is ready to read
// Check if data is ready to read
bool dataReady;
while (dataReady == false) {

status1 = scd4x_get_data_ready_flag(&dataReady);
}

// Get the ticks. The scd4x_read_measurement function is giving incorrect data due to the arthimetic
// Get the ticks. The scd4x_read_measurement function is giving
// incorrect data due to the arthimetic
uint16_t co2;
uint16_t temp;
uint16_t humidity;
Expand All @@ -70,10 +70,8 @@ int main() {

// Print results to terminal (output)
printf("C:%d,T:%d,H:%d", co2, tempInFarenheit, humidityPercent);

// Sleep for 5 seconds.
sleep_ms(5000);
}
}


3 changes: 2 additions & 1 deletion sample-implementations/RaspberryPi_Pico/sensirion_i2c_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ int8_t sensirion_i2c_hal_read(uint8_t address, uint8_t* data, uint16_t count) {
* @param count number of bytes to read from the buffer and send over I2C
* @returns 0 on success, error code otherwise
*/
int8_t sensirion_i2c_hal_write(uint8_t address, const uint8_t* data,uint16_t count) {
int8_t sensirion_i2c_hal_write(uint8_t address, const uint8_t* data,
uint16_t count) {
// I2C Default is used (I2C0).
int status = i2c_write_blocking(i2c_default, address, data, count, true);

Expand Down

0 comments on commit 896ff77

Please sign in to comment.