A feature-rich photography light meter application for the M5Stack Cardputer, developed in MicroPython. It provides both APERure Priority and Shutter Priority modes with a responsive and intuitive user interface.This is a C++ version of nongxl/cardputer_LightMeter.
- M5Stack Cardputer
- M5Stack DLight Unit (I2C Ambient Light Sensor)
- Dual-Mode Metering: Supports APERure Priority (
A) and Shutter Priority (S) modes to suit different shooting scenarios. - Real-Time Calculation: After adjusting any exposure parameter (ISO, APERure, Shutter), the third parameter is calculated and updated instantly without any confirmation needed.
- Intuitive UI:
- The left side clearly displays the final exposure combination of ISO, APERure (
APER), and Shutter Speed (SSPD). - The right side features a vertical selection list for the currently adjustable parameter, providing clear context.
- The currently focused parameter and the selected value in the list are highlighted in green for clear operational focus.
- The left side clearly displays the final exposure combination of ISO, APERure (
- Smart Boundary Detection:
- When an option in the selection list would cause the calculated result to exceed the preset range (e.g., a shutter Speed faster than 1/4000s), that option is marked in red.
- The application prevents the user from selecting red-marked invalid options, ensuring operations stay within a valid exposure range.
- Non-Circular Selection: The parameter list stops scrolling when it reaches the maximum or minimum value, which is more precise and aligns with professional habits.
- Hardware Info: Displays the real-time LUX value from the DLight sensor and the device's battery level.
Tabkey: Cycles the operational focus between ISO, APERure (APER), and Shutter Speed (SSPD).i/a/skeys: Directly switch operational focus and metering mode.akey: Sets to APERure Priority mode and moves focus to APERure (APER).skey: Sets to Shutter Priority mode and moves focus to Shutter Speed (SSPD).ikey: Moves focus to ISO. This action does not change the current metering mode (A/S).
.key (Up Arrow): Scrolls up and selects a value for the focused parameter.;key (Down Arrow): Scrolls down and selects a value for the focused parameter.
I have added the compiled .bin firmware and uploaded it to M5Burner. You can now directly download and burn this firmware using M5Burner.
If you want to keep the ability to run multiple firmwares on your Cardputer, you can use M5Launcher to load the Light Meter firmware:
-
Burn M5Launcher Firmware: First, use M5Burner to burn the M5Launcher Cardputer firmware onto your Cardputer.
-
Download the Light Meter Firmware: Use M5Burner to download the Cardputer Photography Light Meter firmware (do not burn it yet).
-
Locate the Firmware File: The downloaded .bin firmware file is stored in M5Burner's installation directory under
packages\firmware. -
Copy to SD Card: Copy the .bin firmware file to the root directory of a microSD card.
-
Load with M5Launcher: Insert the microSD card into your Cardputer, power it on, and use M5Launcher to select and load the Light Meter firmware.
-
Install Required Software:
- Download and install Visual Studio Code.
- Install the PlatformIO IDE extension for VSCode.
- Ensure you have the necessary USB drivers for your Cardputer installed.
-
Clone the Repository:
git clone https://github.com/your-username/cardputer_LightMeter_Cpp.git cd cardputer_LightMeter_Cpp -
Open the Project in VSCode:
- Launch VSCode.
- C 8000 lick on "File" > "Open Folder" and select the cloned repository folder.
- PlatformIO should automatically detect the project configuration.
-
Install Dependencies:
- Wait for PlatformIO to initialize the project.
- The dependencies are defined in the
platformio.inifile and should be installed automatically. - If not, click on the PlatformIO icon in the sidebar, then click on "Install All Libraries" in the "Project Tasks" section.
-
Connect Your Device:
- Connect your Cardputer to your computer via a USB-C cable.
- Press and hold the G0 button while connecting to enter download mode if necessary.
-
Build and Upload:
- Click on the PlatformIO icon in the sidebar.
- Under "Project Tasks" > "m5cardputer" > "General", click on "Upload".
- This will build the project and upload the firmware to your Cardputer.
-
Monitor Output (Optional):
- To view serial output, click on "Monitor" under the same "General" section.
- This will open a serial monitor showing debug information from the device.
This project is licensed under the PolyForm Noncommercial License 1.0.0 - see the LICENSE file for details.
这是一款为 M5Stack Cardputer 打造的功能完善的摄影测光表应用,使用 MicroPython 开发。它提供了光圈优先和快门优先两种核心测光模式,并拥有一个响应迅速、交互直观的用户界面。这是一个基于nongxl/cardputer_LightMeter项目重构的C++版本
- M5Stack Cardputer
- M5Stack DLight Unit (I2C 环境光传感器)
- 双模式测光: 支持光圈优先 (
A) 和快门优先 (S) 模式,满足不同拍摄场景的需求。 - 实时计算: 调整任何曝光参数(ISO、光圈、快门)后,程序会立即计算出第三个参数的值,无需等待或确认。
- 直观的用户界面:
- 左侧清晰显示 ISO、光圈 (
APER) 和快门速度 (SSPD) 的最终曝光组合。 - 右侧为当前可调参数的纵向选择列表,提供清晰的上下文。
- 当前拥有输入焦点的参数和在列表中选中的值,均以绿色高亮显示,操作目标明确。
- 左侧清晰显示 ISO、光圈 (
- 智能边界检测:
- 当待选列表中的某个选项会导致计算结果超出预设范围时(例如,计算出的快门速度快于 1/4000s),该选项会在列表中被标为红色。
- 程序会阻止用户选择被标为红色的无效选项,确保操作始终在有效曝光组合内。
- 非循环选择: 参数列表在选择到最大或最小值后会停止滚动,操作更精确、更符合专业习惯。
- 硬件信息显示: 实时显示 DLight 传感器读取的 LUX 值和设备电量。
Tab键: 在 ISO、光圈 (APER) 和快门速度 (SSPD) 之间循环切换操作焦点。i/a/s键: 直接切换操作焦点和测光模式。a键: 设定为 光圈优先 模式,并将操作焦点切换到光圈 (APER)。s键: 设定为 快门优先 模式,并将操作焦点切换到快门速度 (SSPD)。i键: 将操作焦点切换到 ISO。此操作不会改变当前的测光模式(光圈/快门优先)。
.键 (上箭头): 向上滚动并选择当前焦点参数的值。;键 (下箭头): 向下滚动并选择当前焦点参数的值。
我添加了编译的.bin固件,已经上传到M5bunner,现在可以直接通过M5bunner下载和烧录这个固件。
如果您想保留在Cardputer上运行多个固件的能力,可以使用M5Launcher加载测光表固件:
-
烧录 M5Launcher 固件:首先,使用M5Burner为您的Cardputer烧录M5Launcher Cardputer固件。
-
下载测光表固件:使用M5Burner下载Cardputer摄影测光表固件(暂时不要烧录)。
-
找到固件文件:下载的.bin固件文件存储在M5Burner安装目录下的
packages\firmware文件夹中。 -
复制到SD卡:将.bin固件文件复制到microSD卡的根目录。
-
使用M5Launcher加载:将microSD卡插入Cardputer,开机后使用M5Launcher选择并加载测光表固件。
-
安装必要软件:
- 下载并安装 Visual Studio Code。
- 为 VSCode 安装 PlatformIO IDE 扩展。
- 确保您已安装 Cardputer 所需的 USB 驱动程序。
-
克隆代码库:
git clone https://github.com/your-username/cardputer_LightMeter_Cpp.git cd cardputer_LightMeter_Cpp -
在 VSCode 中打开项目:
- 启动 VSCode。
- 点击 "文件" > "打开文件夹",选择克隆的代码库文件夹。
- PlatformIO 应该会自动检测项目配置。
-
安装依赖项:
- 等待 PlatformIO 初始化项目。
- 依赖项在
platformio.ini文件中定义,应该会自动安装。 - 如果没有自动安装,点击侧边栏中的 PlatformIO 图标,然后在 "项目任务" 部分点击 "安装所有库"。
-
连接设备:
- 使用 USB-C 数据线将您的 Cardputer 连接到电脑。
- 如有必要,在连接时按住 G0 按钮以进入下载模式。
-
编译和上传:
- 点击侧边栏中的 PlatformIO 图标。
- 在 "项目任务" > "m5cardputer" > "通用" 下,点击 "Upload"。
- 这将编译项目并将固件上传到您的 Cardputer。
-
监控输出(可选):
- 要查看串行输出,点击同一 "通用" 部分下的 "Monitor"。
- 这将打开一个串行监视器,显示来自设备的调试信息。
本项目采用 PolyForm Noncommercial License 1.0.0 协议授权 - 详情请参阅 LICENSE 文件。