Skip to content

Commit 3346db4

Browse files
kwagyemanclaude
andcommitted
docs: add Vision Sensors tutorial super-section
New `openmvcam/tutorial/vision/` walks the imaging stack from optics to API: pinhole → lens → field of view → real-lens effects; sensor grid → shutter types → exposure/gain → calibration → data bus; Bayer CFA → debayering → ISP pipeline; pixel formats; CSI basics → framebuffers → image preview → sensor knobs; multi-sensor capture; memory pools; wrap up. Also: - Refresh hardware/wrap-up.rst to match the Python overview template (recap bullets, "Using this reference later", "Where to go from here"). - Delete obsolete script_structure.rst and system_architecture.rst (folded into the new vision section). - Fix LCD shield backlight pin reference: P5 → P6. - Enable sphinx.ext.mathjax so the math directives used in the optics pages render. - CSS specificity fix for the homepage hero so the Shibuya section-margin defaults stop pushing the headline around. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a119065 commit 3346db4

47 files changed

Lines changed: 3843 additions & 175 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ def _render_landing_code(src):
284284
"sphinx.ext.autodoc",
285285
"sphinx.ext.doctest",
286286
"sphinx.ext.intersphinx",
287+
"sphinx.ext.mathjax",
287288
"sphinx.ext.todo",
288289
"sphinx.ext.coverage",
289290
# Auto-generates /llms.txt + /llms-full.txt during the build so LLMs

docs/openmvcam/shields/lcd-shield.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ Pin reference
3434
"P0", "SPI MOSI — data out to the LCD"
3535
"P2", "SPI clock"
3636
"P3", "SPI chip select"
37-
"P5", "Backlight control"
37+
"P6", "Backlight control"
3838
"P7", "LCD reset"
3939
"P8", "SPI command (data / command select)"
4040
"3.3V rail", "Powers the LCD"
4141
"GND rail", "Common ground"
4242

4343
.. note::
4444

45-
Cut the solder trace on the back of the shield to disconnect P5
45+
Cut the solder trace on the back of the shield to disconnect P6
4646
from the backlight; the backlight is then permanently on.
4747

4848
Usage
@@ -99,7 +99,7 @@ whenever it needs to update the level::
9999
csi0.pixformat(csi.RGB565)
100100
csi0.framesize((128, 160))
101101

102-
lcd = display.SPIDisplay(backlight=PWMBacklight("P5"))
102+
lcd = display.SPIDisplay(backlight=PWMBacklight("P6"))
103103
lcd.backlight(50) # 0–100
104104
clock = time.clock()
105105

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,66 @@
11
Wrap up
22
=======
33

4-
The :mod:`machine` module is now a familiar surface. The
5-
camera can talk to the physical world along several paths:
6-
7-
* **GPIO output and input.** Drive an LED, switch a transistor,
8-
read a button -- the building blocks of every hardware
9-
project. Pull resistors and debouncing make those reads
10-
reliable.
11-
* **Analog signals.** Read a sensor or a potentiometer with
12-
the ADC; produce a controlled voltage with PWM and an RC
13-
filter when no DAC is available.
14-
* **PWM applications.** Dim an LED, vary the speed of a DC
15-
motor through an H-bridge, position a servo. Same waveform,
16-
different averagers (the eye, the motor's inductance) and
17-
different framing (duty cycle vs absolute pulse width).
18-
* **Serial buses.** UART for asynchronous point-to-point
19-
links; SPI for fast on-board peripherals with one CS per
20-
device; I2C for slow multi-device sensor buses on just two
21-
wires; CAN for robust multi-master field buses between
4+
You have walked through the parts of the :mod:`machine`
5+
module that come up the moment a script talks to the
6+
physical world:
7+
8+
* **GPIO output and input** -- driving an LED or a
9+
transistor, reading a button or a limit switch. The
10+
building blocks every hardware project rests on, with pull
11+
resistors and software debouncing for reads that have to
12+
be reliable.
13+
14+
* **Analog signals** -- reading a sensor, a potentiometer, or
15+
any other continuously-varying voltage with the ADC; and,
16+
when no DAC is available, producing a controlled voltage
17+
with PWM and a low-pass RC filter.
18+
19+
* **PWM applications** -- dimming an LED, varying the speed
20+
of a DC motor through an H-bridge, positioning a servo.
21+
One waveform, different physical averagers (the eye, the
22+
motor's inductance) and different framings (duty cycle
23+
versus absolute pulse width).
24+
25+
* **Serial buses** -- :mod:`UART` for asynchronous
26+
point-to-point links; :mod:`SPI` for fast on-board
27+
peripherals with one chip-select per device; :mod:`I2C`
28+
for slow multi-device sensor buses on just two wires;
29+
:mod:`CAN` for robust multi-master field buses between
2230
modules.
23-
* **Production patterns.** A watchdog timer to recover from
24-
hangs; sleep modes to stretch a battery; both essential the
25-
first time a camera leaves the bench.
2631

27-
That coverage is enough to build the "sense, plan, act" loop
28-
of an embedded device: read sensors over I2C / SPI / ADC,
29-
make decisions in Python, drive actuators through PWM / GPIO,
32+
* **Production patterns** -- a watchdog timer to recover
33+
from hangs, sleep modes to stretch a battery. Both become
34+
essential the first time a camera leaves the bench.
35+
36+
That is enough to build the *sense -- plan -- act* loop of
37+
an embedded device: read sensors over I2C / SPI / ADC, make
38+
decisions in Python, drive actuators through PWM / GPIO,
3039
report status over UART / CAN, sleep between events.
3140

32-
What is *not* in this section is the camera's other half --
33-
its imaging pipeline. That is the subject of the next
34-
super-section, which picks up where the :mod:`machine` module
35-
leaves off and shows how the same Python loop drives an
36-
image sensor, runs computer-vision algorithms over the frames,
37-
and feeds the results back into the same actuators and buses
38-
covered here.
41+
Using this reference later
42+
--------------------------
43+
44+
Treat the hardware chapters as reference material, not a
45+
one-pass read. The :mod:`machine` module reference page
46+
lists every class and method in one place when the question
47+
is just "what is the exact name of this call". The
48+
per-chapter pages here are where to come back for the
49+
"which knob does what, and why" view that the reference
50+
material does not give on its own.
51+
52+
Where to go from here
53+
---------------------
54+
55+
**Vision sensors** is the next major topic. Where this
56+
section taught the generic peripherals -- Pin, ADC, PWM,
57+
UART, SPI, I2C, CAN -- that show up on almost any MCU, the
58+
next section teaches the camera's *defining* peripheral
59+
very deeply: the image sensor, and the long chain of
60+
optics, silicon, and signal processing between photons
61+
hitting glass and a buffer of pixels in RAM. The toolkit
62+
shifts to the :mod:`csi` and :mod:`image` modules, but
63+
everything you have learned about driving GPIOs, talking
64+
over I2C, and using PWM carries forward unchanged --
65+
strobes, triggers, and sensor shields all use the same
66+
buses you have just covered.

docs/openmvcam/tutorial/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ The OpenMV Cam tutorial covers how to use your OpenMV Cam and its accessories.
1818

1919
hardware/index.rst
2020

21-
script_structure.rst
22-
system_architecture.rst
21+
vision/index.rst
2322

2423
numpy/index.rst
2524

docs/openmvcam/tutorial/script_structure.rst

Lines changed: 0 additions & 62 deletions
This file was deleted.

docs/openmvcam/tutorial/system_architecture.rst

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)