#include <stdio.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h"
All posts by
.Using the I2C interface
I2C Pins Typically you can use any GPIO: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/i2c.html To confirm, see the S# series datasheet for the ESP device you are using > Peripheral Pin Configurations Resources https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/i2c.html https://github.com/espressif/esp-idf/tree/master/examples/peripherals/i2c I2C Address Set as normal byte address including RW at bit 0.So 0b01101000 is set as 0x68, not (0x68 >> 1) I2C Master Example write, […]
.IO Pin Control General
Documentation https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/gpio.html Input Pins Combined method Individual functions method Output Pins Disable Pins
Delays
Delay in mS The RTOS tick period is (by default) 10ms N.B. vTaskDelay is no good for small mS delays. It is based on the RTOS tick rate. If you select a value < portTICK_PERIOD_MS you may get a zero delay or you may get a delay of portTICK_PERIOD_MS (so 10mS). We’ve also found instances […]
Making Eclipse work properly
Eclipse defaults are different to lots of IDE’s we use on Windows, here’s how we fix eclipse… Open eclipse preferences: Menu > Window > Preferences General > Workspace > Build > Save automatically before build General > Keys To Upper Case – Ctrl + Shift + U To Lower Case – Ctrl + Shift + L […]
Creating A New Project
Our Eclipse IDE resources here may well be old, we’ve switched over to using VSCode Resources https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md NOTE: The esp-idf build system does not support spaces in paths to projects Create a project In Eclipse Menu > File > New > Project… Espressif > Espressif IDF Project Set the name and location (DO NOT USE […]
Terminal window
Pause the Terminal window CTRL+T then CTRL+Y Getting command prompt You may need to use CTRL + ] to end its current mode and get its command prompt first Getting “ESP-IDF Terminal” instead of powershell You need the “ESP-IDF Terminal”, if your open Terminal is Powershell, kill it and then use command prompt (CTRL_SHIFT+P) and […]
Installing ESP-IDF (Windows)
Note, if you are going to use Visual Studio Code then you can let its Espressif plugin handle installing ESP-IDF – see here Espressif guides https://docs.espressif.com/projects/esp-idf/en/stable/get-started/ Setting up a Windows PC to program the ESP32 Create the required GNU-compatible environment with toolchain (the programs to compile and build your applications) Download the Windows all-in-one toolchain from https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/windows-setup.html […]
I2C Pins
Pin assignment Both I2C interfaces are connected to pins via GPIO matrix, so you can select arbitrary IO pins for SDA and SCL. You just need to observe the constraints of each pin such as I/O capability (GPIO34 – 39 are input only so not suited!), bootstrapping function. See the series datasheet for your device […]
.IO Pins General
REMEMBER NOT ALL ESP32 PINS ARE INPUT/OUTPUT – SOME ARE INPUT ONLY!!!! ESP32 Pin List All of the pin fucntions, default state, etc: https://www.espressif.com/sites/default/files/1a-esp32_pin_list_en-v0.1.pdf Peripheral pins assignment See here Pull ups / pull downs Only pins that support both input & output have integrated pull-up and pull-down resistors. Input-only GPIOs 34-39 do not.
