ESP32-CAM导入ino项目编译和烧录

文章目录

ESP32 Cam 模式
接线图


导入ino项目
选择INO打开
目录结构

platformio.ini

bash 复制代码
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32cam]
platform = espressif32
board = esp32cam
framework = arduino
手动转换成C++

https://docs.platformio.org/en/latest/faq/ino-to-cpp.html

源代码
c 复制代码
#include <Arduino.h>

void setup() {
  pinMode(33, OUTPUT); // 将GPIO33设置为输出模式
}

void loop() {
  digitalWrite(33, HIGH); // 设置GPIO33输出高电平
  delay(1000); // 延时等待1000毫秒,即1秒
  digitalWrite(33, LOW); // 设置GPIO33输出低电平
  delay(1000); // 延时等待1000毫秒,即1秒
}
编译

Ctrl+Alt+B

效果图
搞猛一点

33为板载led红灯
4为闪光灯

bash 复制代码
#include <Arduino.h>
void setup()
{
  pinMode(33, OUTPUT); // 将GPIO33设置为输出模式
  pinMode(4, OUTPUT);  // 将GPIO33设置为输出模式
}

void loop()
{
  digitalWrite(33, HIGH); // 设置GPIO33出书输出高电平
  digitalWrite(4, HIGH);  // 设置GPIO33出书输出高电平
  delay(1000);            // 延时等待1000毫秒,即1秒

  digitalWrite(4, LOW);  // 设置GPIO33出书输出低电平
  digitalWrite(33, LOW); // 设置GPIO33出书输出低电平
  delay(1000);           // 延时等待1000毫秒,即1秒
}

效果图有点闪眼睛,自行脑部

其他实验

https://docs.geeksman.com/esp32

相关推荐
Ronin-Lotus18 小时前
嵌入式硬件篇---ESP32稳压板
嵌入式硬件·esp32·稳压板
sakabu1 天前
ESP32 外设驱动开发指南 (ESP-IDF框架)——GPIO篇:基础配置、外部中断与PWM(LEDC模块)应用
笔记·单片机·学习·esp32
湮雨塵飛2 天前
1. ESP开发之实体按键(KEYPAD&BUTTON)控制LVGL控件
esp32·lvgl·实体按键
Ronin-Lotus4 天前
嵌入式硬件篇---ESP32驱动异常
嵌入式硬件·esp32
Ronin-Lotus4 天前
程序代码篇---数据包解析
python·esp32·数据包解析
IT项目分享5 天前
ESP32 BLE开发快速入门:用MicroPython实现手机与硬件通信
esp32·micropython·it项目网
Ronin-Lotus5 天前
嵌入式硬件篇---驱动板
单片机·嵌入式硬件·esp32·驱动板
flashier6 天前
ESP32学习笔记_Components(1)——使用LED Strip组件点亮LED灯带
学习·esp32·led·led灯带·esp32组件
flashier7 天前
ESP32学习笔记_Peripherals(4)——MCPWM基础使用
单片机·学习·esp32·pwm·mcpwm
IT项目分享9 天前
ESP32-CAM实战:DIY基于OpenAI的AI视觉识别相机
人工智能·数码相机·esp32·智能硬件·it项目网