Skip to content

Commit

Permalink
0x2C
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Aug 19, 2024
1 parent e2d2ffc commit 261706e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Here are some examples of using i2cset and i2cget to interact with this program:

To set the duty cycle of the PWM channel corresponding to address 0 to 75%, you could use the following i2cset command:

i2cset -y 1 0x30 0 0xC0
i2cset -y 1 0x2C 0 0xC0

To read the 16-bit ADC value of the ADC channel corresponding to address 4, you could use the following i2cget command:

i2cget -y 1 0x30 w 4
i2cget -y 1 0x2C w 4

Note that the -y flag is used to automatically answer yes to any prompt from i2cset or i2cget.
The 1 after the -y flag specifies the i2c bus number to use, and the 0x30 specifies the i2c address of the peripheral.
The 1 after the -y flag specifies the i2c bus number to use, and the 0x2C specifies the i2c address of the peripheral.
The 0 and w in the i2cset and i2cget commands, respectively, specify the starting register address to be accessed.
The 4 in the i2cget command specifies the address of the ADC channel to read.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "hardware/clocks.h"


#define I2C1_PERIPHERAL_ADDR 0x29
#define I2C1_PERIPHERAL_ADDR 0x2C

#define GPIO_SDA0 14
#define GPIO_SCK0 15
Expand Down

0 comments on commit 261706e

Please sign in to comment.