Skip to content

Commit e3cd2b1

Browse files
authored
Merge pull request #14 from openmv/update_readme
docs: Update readme.
2 parents 402b6c8 + d5a0380 commit e3cd2b1

File tree

1 file changed

+49
-15
lines changed

1 file changed

+49
-15
lines changed

README.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,63 @@ with Camera('/dev/ttyACM0') as camera:
110110

111111
## API Reference
112112

113-
See [docs/api.md](docs/api.md) for full API documentation.
113+
Full API documentation: [docs/api.md](docs/api.md)
114114

115-
### Quick Reference
115+
### Camera
116116

117117
```python
118-
from openmv import Camera, OMVException, TimeoutException
118+
from openmv import Camera
119119

120-
with Camera('/dev/ttyACM0') as camera:
121-
camera.stop() # Stop running script
122-
camera.exec(script) # Execute script
123-
camera.streaming(True) # Enable streaming
124-
frame = camera.read_frame() # Read video frame
125-
text = camera.read_stdout() # Read script output
126-
status = camera.read_status() # Poll channel status
127-
info = camera.system_info() # Get system info
120+
Camera(
121+
port, # Serial port (e.g., '/dev/ttyACM0')
122+
baudrate=921600, # Serial baudrate
123+
crc=True, # Enable CRC validation
124+
seq=True, # Enable sequence number validation
125+
ack=True, # Enable packet acknowledgment
126+
events=True, # Enable event notifications
127+
timeout=1.0, # Protocol timeout in seconds
128+
max_retry=3, # Maximum retries
129+
max_payload=4096, # Maximum payload size
130+
drop_rate=0.0, # Packet drop simulation (testing only)
131+
)
128132
```
129133

134+
### Methods
135+
136+
| Method | Description |
137+
|--------|-------------|
138+
| `connect()` / `disconnect()` | Manage connection |
139+
| `is_connected()` | Check connection status |
140+
| `exec(script)` | Execute a MicroPython script |
141+
| `stop()` | Stop the running script |
142+
| `streaming(enable, raw=False, res=None)` | Enable/disable video streaming |
143+
| `read_frame()` | Read video frame → `{width, height, format, depth, data, raw_size}` |
144+
| `read_stdout()` | Read script output text |
145+
| `read_status()` | Poll channel status → `{channel_name: bool, ...}` |
146+
| `has_channel(name)` | Check if channel exists |
147+
| `channel_read(name, size=None)` | Read from custom channel |
148+
| `channel_write(name, data)` | Write to custom channel |
149+
| `channel_size(name)` | Get available data size |
150+
| `system_info()` | Get camera system information |
151+
| `host_stats()` / `device_stats()` | Get protocol statistics |
152+
153+
#### Profiler Methods (if available)
154+
155+
| Method | Description |
156+
|--------|-------------|
157+
| `read_profile()` | Read profiler data |
158+
| `profiler_mode(exclusive)` | Set inclusive/exclusive mode |
159+
| `profiler_reset(config=None)` | Reset profiler counters |
160+
| `profiler_event(counter_num, event_id)` | Configure event counter |
161+
130162
### Exceptions
131163

132-
- `OMVException` - Base protocol exception
133-
- `TimeoutException` - Timeout during communication
134-
- `ChecksumException` - CRC validation failure
135-
- `SequenceException` - Sequence number mismatch
164+
| Exception | Description |
165+
|-----------|-------------|
166+
| `OMVException` | Base protocol exception |
167+
| `TimeoutException` | Timeout during communication |
168+
| `ChecksumException` | CRC validation failure |
169+
| `SequenceException` | Sequence number mismatch |
136170

137171
## Requirements
138172

0 commit comments

Comments
 (0)