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

已完成 已发布的 4 年前 货到付款
已完成 货到付款

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 微控制器 电子 嵌入式软件 C 编程

项目ID: #23190812

关于项目

17个方案 远程项目 活跃的4 年前

授予:

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 更多

$135 USD 在5天内
(89条评论)
6.8

有17名威客正在参与此工作的竞标,均价$157/小时

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 在7天内
(18条评论)
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 更多

$140USD 在1天里
(98条评论)
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 更多

$200 USD 在7天内
(16条评论)
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 更多

$100 USD 在3天内
(7条评论)
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 在7天内
(26条评论)
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 在7天内
(14条评论)
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 更多

$111 USD 在4天内
(27条评论)
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 在3天内
(7条评论)
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 在7天内
(8条评论)
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 更多

$140 USD 在7天内
(0条评论)
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 更多

$150 USD 在4天内
(0条评论)
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 在3天内
(0条评论)
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 在21天内
(0条评论)
0.0