This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:iot-open:practical:hardware:sut:esp32:emb2_1 [2024/04/20 08:19] – pczekalski | en:iot-open:practical:hardware:sut:esp32:emb2_1 [2025/04/28 20:31] (current) – [Steps] pczekalski | ||
---|---|---|---|
Line 75: | Line 75: | ||
<note tip> | <note tip> | ||
=== Step 1 === | === Step 1 === | ||
- | Define I2C bus GPIOs: clock (SCL) uses GPIO 4 and data (SDA) GPIO 5. ADC uses GPIO 7. Digital potentiometer chip DS1803 uses 0x28 I2C address. All definitions are present in the following code: | + | Define I2C bus GPIOs: clock (SCL) uses GPIO 4, and data (SDA) uses GPIO 5. ADC uses GPIO 7. Digital potentiometer chip DS1803 uses 0x28 I2C address. All definitions are present in the following code: |
<code c> | <code c> | ||
#define SCL 4 | #define SCL 4 | ||
Line 94: | Line 94: | ||
Wire.begin(SDA, | Wire.begin(SDA, | ||
delay(100); | delay(100); | ||
+ | ... | ||
+ | | ||
pinMode(POT_ADC, | pinMode(POT_ADC, | ||
</ | </ | ||
+ | |||
+ | <note important> | ||
=== Step 4 === | === Step 4 === | ||
- | Read the loopback characteristics of the digital potentiometer to ADC loop and store it in the array: | + | Read the loopback characteristics of the digital potentiometer to the ADC loop and store it in the array: |
<code c> | <code c> | ||
for(byte i=0; i<128; i++) | for(byte i=0; i<128; i++) |