Instruction file imported from iginoc/igitimer (
.cursor/rules/pebble.mdc). Copyright stays with the author.
Project Overview
This is a Pebble smartwatch application written in C using the Pebble SDK.
Supported Platforms
The app targets multiple Pebble watch models:
- aplite (Pebble classic)
- basalt (Pebble Time)
- chalk (Pebble Time Round)
- diorite (Pebble 2)
- emery (Pebble Time 2)
- flint (Pebble 2 Duo)
Commands
# Build the app for all platforms
pebble build
# Clean build artifacts
pebble clean
# Install the app on specific emulator
pebble install --emulator basalt
# Screenshot the running emulator
pebble screenshot --no-open screenshot.png
If you need more information on the pebble command or a sub-command, append --help.
Project Structure
src/c/ - C source files for the watchapp
src/pkjs/ - PebbleKitJS files (currently empty)
worker_src/c/ - Worker source files (optional, not present)
resources/ - Images, fonts, and other resources (not present)
Configuration
By default, this project is initialized as a watchface. To make it an app, replace "watchface": true with "watchface": false in package.json.
Architecture
The application follows the standard Pebble app architecture:
- Main Entry Point:
src/c- Themain()function initializes the app and starts the event loop - Window Management: Single window app with text layer for displaying button press feedback
- Event Handling: Button click handlers registered via
prv_click_config_providerfor UP, DOWN, and SELECT buttons
SDK Documentation
The full Pebble SDK documentation is available at https://developer.repebble.com.
Main Categories:
- Tutorials - Step-by-step learning (C watchface tutorial in 5 parts, advanced topics)
- Developer Guides - Comprehensive reference organized by topic
Key Sections:
- App Resources - Images, fonts, vector graphics, 256 resource limit
- User Interfaces - Layer hierarchy, TextLayer, MenuLayer, round vs rectangular displays
- Events & Services - Buttons, accelerometer, compass, health data, background workers
- Communication - Bluetooth AppMessage, PebbleKit JS/Android/iOS integration
- Graphics & Animations - Drawing APIs, property animations, vector graphics
- Debugging - App logs, GDB, common errors and solutions
- Best Practices - Multi-platform support, battery conservation, modular architecture
- Design & Interaction - Glance-first design, one-click actions, platform guidelines
- App Store Publishing - Submission requirements, assets, analytics
Key Entry Points:
- https://developer.repebble.com/tutorials/watchface-tutorial/part1 - C development start
- https://developer.repebble.com/guides/events-and-services/buttons - Button handling
- https://developer.repebble.com/guides/user-interfaces/layers - UI foundations
Development Best Practices
- Whenever making changes, run
pebble screenshotand view the screenshot to make sure it's what the user requested. If not, make more changes until it does what it's supposed to.
AI Interaction Guidelines
- When given an image of a watchface to replicate, describe the target watchface in precise detail. Note every visual element present, as well as size, alignment, font weight, spacing, and location.
AI Code Review Guidelines
- Once you think you've fulfilled the user's request, ask yourself if you see any issues with the current screenshot, and if there are any differences between the screenshot and the reference image or the user's description. If so, fix them.