# Circuit Studio functional kit activities

Actual CPython programs run in a disposable browser Worker using the same locally hosted Pyodide distribution as the AI Lab and Python Inventor. `from airo_kit import kit` addresses explicit virtual application drivers. It does not execute the selected board's native firmware. Blocks/basic GPIO recipes and supported compiled AVR/ESP firmware remain separate tools in Circuit & wiring. Do not upload these Python exports to a PIC, STM32, Teensy, micro:bit or ESP and expect them to run unchanged.

Each starter opens the 2D circuit first. Try experiment loads a working editable application. 3D Build opens its linked lab assembly; micro:bit and AIoT have assembled rover test arenas. The other kits share their 2D module connections, OLED framebuffer, LED states, motor/servo motion and dial with their3D bench views. External-device availability follows the circuit graph; a disconnected required module or shorted supply stops the activity. Low-level I2C/SPI/I2S/USB/radio signalling, device registers and analogue transient behaviour are not covered by this application driver.

## Activities

| Kit | Linked functional behaviour | Deliberate approximation |
|---|---|---|
| micro:bit Explorer | P1/P2 continuous-servo drive, 5×5 matrix, two-wheel arena | Pulse/speed calibration and slip/torque are not modelled; A/B inputs represent onboard buttons.3×AAA motor supply. |
| Smart Space, ESP32-C6 | BME280 synthetic room inputs, live OLED and condition-controlled LED | I2C GPIO6/7, CS/SDO high for0x77. LDR GPIO11 is a digital fixture input, not a native ADC model. No Wi-Fi networking. |
| Control Lab, STM32 | DRV8833 direction/PWM, geared motor, encoder count, load experiment and OLED | Software-I2C reference PB0/PB1; PA5/PA4 driver, PA0/PA1 motor encoder; PA6/PA7/PA10 dial.180RPM nominal,0.18s lag and1200 counts/wheel revolution are educational assumptions. Not a hardware-validated PID tuning tool. |
| BLE Motion, XIAO Sense | Board orientation produces gravity-vector values and a programmable LED/gesture response; synthetic sound level | IMU and microphone are onboard, not duplicated external modules. No physical microphone, PDM/IMU registers, BLE, gesture-trained neural model or native nRF firmware. |
| Automation Logic, PIC | Programmable servo gate, light threshold, dial and three traffic-light outputs | RA4/RA5/RB7 lights, RC1 servo, RA2 light; RC0/RB5/RC3 dial.5V servo supply separate from3.3V Nano logic. Servo limited90degrees/s, no torque/collision. No PIC instructions or configurable-logic-block engine. |
| Tiny Inventions, ATtiny | Light condition, LED, timed reminder and audible browser buzzer with reset | PA4LED, PA7light, PA6buzzer, PA5reset/PB0stop. No native tinyAVR instruction execution. Buzzer driver and ratings need bench verification. |
| Sound Lab, Teensy | Actual browser oscillator, frequency/gain control, waveform view and generated PCM/WAV buffer gated by audio/mic/headphone/SD connections | SGTL5000 driver, microphone input and SD are virtual. Recording generates a PCM snapshot of the configured tone, not a physical mic or complete SD filesystem. No I2S/SPI/codec register/RT1062 emulation. |
| AIoT Vision, ESP32-S3 | Four-wheel mecanum movement, onboard virtual camera rendered from rover pose, colour segmentation from actual pixels | Four motor-HAT channels, GPIO21/47I2C, separate6V motor and5V sensor supplies; GPIO1TRIG/2ECHO via translator,14IR. Planar kinematics, bounded arena, no force/slip/roller-contact dynamics. No OV2640 register engine, Wi-Fi, BPU/Hailo or AI neural inference. |

Board CAD and custom assemblies are reference illustrations, not pin-placement or packing certifications. Some logical pins added to the teaching adapters use illustrative board contacts; check the exact vendor pinout before real wiring. Mechanical fit, exact carrier/harnesses, sensor polarity, load/servo power and module voltage compatibility must be validated on the physical prototype. The simulation is not proof that every kit has been bench-built.

## Python virtual API

- `await kit.read()` returns synthetic inputs, toggled A/B, experiment seconds and relevant pose/RPM/encoder/servo/gravity fields. Unused fields are present for a common lesson API. `distance_cm` is an arena ray measurement for the AIoT rover, not a real ultrasonic acquisition protocol. A/B use diagram switches or the encoder switch where present; otherwise they are explicit test inputs.
- `await kit.write(name,value)` writes only a profile-supported output. Drive/motor values range−1..1, LEDs/buzzer0..1, servo0..180°, frequency40..2000Hz, gain0..0.25. micro:bit `matrix` accepts25 brightness values0..9.
- `await kit.display(lines)` accepts up to5 strings. This drives the physical virtual OLED only in kits that contain one; otherwise it is the on-screen activity monitor, not an invented kit display.
- `await kit.sleep(seconds)` yields browser time,0.01..30seconds.
- `await kit.camera()` on AIoT returns red/blue region centroids in normalized image coordinates and pixel counts. Detection scans rendered RGBA pixels; it does not read scene object labels/positions. A fixed threshold can merge multiple regions of the same colour.
- `await kit.record(seconds)` on Sound Lab creates a virtual PCM tone buffer at16kHz mono, up to10seconds; WAV exports that buffer. Audio begins only after user interaction and stops when muted, power is lost, the activity is stopped/hidden or another kit is selected. No microphone permission is requested.

Try experiment, editable Python, manual output buttons, inputs, Stop/reset, virtual power, project save/load, Python/PNG and Sound Lab WAV exports are provided. Experiment JSON stores code and input settings; circuit JSON separately stores wiring and physical switch states. Load wiring first. Outputs/pose are reset deliberately; an experiment import is not a hardware state snapshot.

Stop terminates the Worker, including a Python infinite loop. Limits:4minutes/run,10000 driver commands,300 output messages,30000 source characters,50000-byte experiment imports, bounded numeric inputs, display text and audio buffers. Power/device disconnections stop the program. Motion and tones stop on normal program completion; static display/LED output is retained for inspection.

## References and provenance

The existing exact-parts proposal, vendor CAD attributions, third-party notices and locally hosted Python licences continue to apply. These are original AiRO application models and lessons, not copied firmware or vendor-validated kit assemblies.

- micro:bit edge connector: https://tech.microbit.org/hardware/edge-connector/
- Ring:bit: https://www.elecfreaks.com/learn-en/microbitKit/ring_bit_v2/ring_bit_car_v2_case_02.html
- ESP32-C6: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html
- STM32 Nucleo: https://www.st.com/resource/en/user_manual/um2953-stm32c0-nucleo64-board-mb1717-stmicroelectronics.pdf
- XIAO Sense: https://wiki.seeedstudio.com/XIAO-BLE-Sense-IMU-Usage/
- PIC16F13145 Nano: https://www.microchip.com/en-us/development-tool/ev06m28a
- ATtiny3227 Nano: https://www.microchip.com/en-us/development-tool/EV58A83A
- Teensy Audio Adaptor: https://www.pjrc.com/store/teensy3_audio.html
- Freenove camera: https://docs.freenove.com/projects/fnk0084/en/latest/fnk0084/codes/C/Preface.html
- Python runtime source and licences: ../python/SOURCE.json, ../python/LICENSE.txt, ../python/CPYTHON-LICENSE.txt

For the ESP32-C6/S3 native GPIO proof fixtures, open the native-firmware panel and use **Load GPIO test circuit**, then load the matching merged BIN. This intentionally loads a small GPIO/UART test circuit rather than pretending that the high-level virtual OLED, camera or motor drivers are native peripherals. The C6 fixture uses GPIO10 output and GPIO11 light input; S3 uses GPIO21 output and GPIO47 button input. It does not change the commercial kit contents.
