ESP32cam add MCP23017 GPIO expander to program and add digital read/write to code

Completado Publicado hace 4 años Pagado a la entrega
Completado Pagado a la entrega

Using this tutorial as a base for the project - [login to view URL] - update to use a MCP23017 GPIO expander (I2C device) - and add digital read/write to code.

Using the adafruit MCP23017 ("Adafruit_MCP23017.h") library (and wire.h or similar library if needed to map I2C pins).

Using this board - [login to view URL] .

Need to map I2C (SDA and SCL pins - suggested using pins 12/SDA and 14/SCL - or other suitable/available pins on the esp32cam - I should not have to do any soldering - or modifications to board!!)

Note - I do not need physical device made or anything else - just code!!

Need to use Arduino IDE - so similar language as tutorial: [login to view URL]

MUST update tutorial code to add digital read/write to MCP23017 ... see sample read/write code below.

Must be able to view webcam and do digital read/write.

*************

// Test circuit for esp32cam

// and MCP23017 GPIO Expander

// Standard SDA is 21 and SCL is 22

// Use wire.h to change SDA SCL pins...

// When Flashing - put USB SDA SCL pins for esp32 on SDA 21 and SCL 22

// When Flashing - put USB on standard flashing pins...

#include <Wire.h> // set [login to view URL](SDA, SCL)

#include "Adafruit_MCP23017.h"

Adafruit_MCP23017 mcp; // Instantiate mcp object

int dly = 500; // 1/4 second delay

void setup(){

[login to view URL](115200);

[login to view URL]("Setup starting: Ready");

[login to view URL](12, 14); // NOTE '//' out [login to view URL] in [login to view URL] library! Or will not map pins!!

[login to view URL](); // "Start" the mcp object

[login to view URL](0, OUTPUT); // relay

[login to view URL](1, INPUT); // push button - green

[login to view URL](1, HIGH); // turn on a 100K pullup internally

[login to view URL](2, INPUT); // touch sensor - filzer custom

[login to view URL](2, HIGH); // turn on a 100K pullup internally

}

void loop(){

// Digital write test - for Relay testing

[login to view URL]("Relay - Flashing GPIO: "); // Tell us what pin is flashing.

[login to view URL](0, HIGH); // Set pin HIGH (on)

delay(dly); // On for 1/4 second

[login to view URL](0, LOW); // Set pin LOW (off)

delay(dly); // Off for 1/4 Second

// digit read test - for push buttons x2

int val1 = [login to view URL](1); // Read the value of pin P1

int val2 = [login to view URL](2); // Read the value of pin P2

if (val1 == HIGH) [login to view URL]("Button: HIGH"); // If Button is Pressed

else

[login to view URL]("Button: LOW"); // When Button is Released

delay(50);

[login to view URL]("\t");

if (val2 == HIGH) [login to view URL]("Touch Sensor: HIGH"); // If Button is Pressed

else

[login to view URL]("Touch Sensor: LOW"); // When Button is Released

delay(50);

[login to view URL]("\t");

[login to view URL]();

}

Arduino Microcontrolador Electrónica Software integrado Programación en C

Nº del proyecto: #23190812

Sobre el proyecto

17 propuestas Proyecto remoto Activo hace 4 años

Adjudicado a:

arrijal1992

Hi, Let's get started. I have used Arduino in both hardware and firmware development since 2013, and in recent years, I've been heavily using ESP32 in both hardware and firmware development. I'm familiar with their ar Más

$135 USD en 5 días
(89 comentarios)
6.8

17 freelancers están ofertando un promedio de $157 por este trabajo

MElizabethp

Hello, my name is Maria. I am an electronic engineer I would like to know more about your project. Let me know on chat.. I am available to work in this

$250 USD en 7 días
(18 comentarios)
6.6
mechatronicsengr

Hi, I hope you are doing well. I have expertise in ESP32 Arduino Programming. I have worked on I/O expander. I have reviewed your requirements. I have several questions regarding project. Which is what do you want t Más

$140 USD en 1 día
(98 comentarios)
7.0
MarcoCiau

Hello, I'm interested in the position of project you recently posted, particularly being from Embedded Systems. I have strong C/C++ skills and experience with ESP8266 & ESP32 microcontrollers with a good knowledge of Más

$200 USD en 7 días
(16 comentarios)
5.2
Tomorrow1201

hello. I have 10+ years experiences related to hardware and firmware development. - Electronics circuit design(schematic, PCB, simulation) - Microcontrollers(Microchip PIC, ARM, AVR, 8051) - Arduino projects(LED, vario Más

$100 USD en 3 días
(7 comentarios)
4.6
BOSIREX

Am a Mechatronic engineer with 5 year experience in microcontrollers and Arduino programming and I believe i can handle your task to perfection

$222 USD en 7 días
(26 comentarios)
4.9
Gerrard97

I am an electrical engineer and interested in your project. I have read the description of your project. Kindly send me text to discuss the project in details. Thanks

$140 USD en 7 días
(14 comentarios)
4.9
SMBelectronics

Hey there Hope you are doing good I read the details about your project, I am skilled electronics and communication engineer, with experience in microcontroller programming, circuit designing and etc. i worked on proje Más

$111 USD en 4 días
(27 comentarios)
5.1
edi45

Hi I am embedded system engineer with 7 years of experience. I used esp32 for main controller of several project. I used arduino to develop the firmware and i am familiar with I2C, let me know if you are interested

$100 USD en 3 días
(7 comentarios)
4.0
kahan1994

HI, I am kahan. I am embedded developer and have much experienced in hardware and software side. Waiting for further discussion. Thank you.

$140 USD en 7 días
(8 comentarios)
3.1
TaiZhe0224

Hello. I am a senior Microcontroller developer and electronic engineer. After reading your description, I am very interested in your project. As you can see in my profile, I have developed the IoT and website , mobile Más

$140 USD en 7 días
(0 comentarios)
0.0
Sheryar26

Hello. I am an experienced embedded developer and I have extensively worked on esp32 projects. Kindly contact me so I can share my portfolio with you. We can decide costs and timeline via chat. I am an expert in esp32 Más

$150 USD en 4 días
(0 comentarios)
0.0
waheedhum

Hi, I have experience in arduino and esp8266 based devices. I can do your project comfortably in three working days. thanks in advance

$100 USD en 3 días
(0 comentarios)
0.0
Sant26

Hi sir, I worked with both Arduino and Esp. Currently working on 1. Esp32 - mqtt and Android communication. 2. STM32 - Lora P2P communication. We will work on your project and will give you the output as you expect.

$222 USD en 21 días
(0 comentarios)
0.0