CAD Cover

12. CNC

[ MISSION: Mastering the art of subtracting material with light and blades.]

What is CNC?

A CNC (Computer Numerical Control) machine is a motorized tool controlled by a computer that executes pre-programmed sequences of commands to manufacture parts with high precision. Unlike manual machining, where an operator moves the tools by hand using wheels and levers, a CNC machine uses software to translate a digital design into physical movement.

[ THE CONTROLLER: RASPBERRY PI PICO 2 ]

For this mission, I chose the Pico 2. I love the workflow using VS Code with the Pico extension—it makes the process much more professional and streamlined.

Pico 2 Pinout

> FIG 01: PINOUT_DIAGRAM

PIN TYPEFUNCTION
PowerVBUS (5V), 3V3, GND
GPIOGeneral purpose Input/Output (3.3V)
ADCAnalog to Digital Converter (12-bit)
PWMPulse Width Modulation (Motor/LED control)
SPECIFICATIONDETAILS
MicrocontrollerRP2350 (Dual Core ARM Cortex-M33)
Clock Speed150 MHz
Memory (SRAM)520 KB Internal
Flash Memory4 MB Off-chip (via QSPI)
LanguagesC/C++, MicroPython, Rust
Communication2x UART, 2x SPI, 2x I2C
Features8x PIO State Machines

SELECT EXECUTION ENVIRONMENT.

[ MISSION: WOKWI SIMULATION ]

STEP 01

Platform Access

Search for Wokwi in your browser and select the first option. You can choose different microcontrollers; I chose the Raspberry Pi Pico 2 based on my previous experience in class.

Wokwi Setup
STEP 02

Language Selection

After selecting the board, various templates appear. While C++ is an option, I decided to use MicroPython to experiment further with the language.

Language Selection
STEP 03

Workspace Interface

The code editor is on the left. The top bar features a green button to run the code, a blue button to add components, and a gray button for the control panel.

Interface Layout
STEP 04

Adding Components

Using the blue "+" button, you can browse and insert various components available in the library to build your virtual circuit.

Components Library
STEP 05

Virtual Wiring

When selecting sensor pins or inputs, Wokwi automatically generates a jumper wire. You just need to click on the target pin to complete the connection.

Wiring Process
STEP 06

Full Circuit Build

The final simulation setup includes an OLED SSD1306, a Joystick, an LED with a 230-ohm resistor, and a push button.

VIEW LIVE SIMULATION

> CLOUD_LINK: WOKWI_PROJECT_ACTIVE

Final Simulation
STEP 07

Live Interaction

Once the simulation is running, you can interact directly with the components (like moving the joystick) as shown in the video.

STEP 08

Custom Libraries

For the OLED to work, I needed a specific library. I clicked the arrow next to the file manager and selected "New File" to add it.

Adding Library
STEP 09

AI Assistance

You can use AI to help generate the necessary driver code for your custom libraries and paste it directly into the new file.

AI Coding
STEP 10

Sharing the Mission

Save your project using the disk icon. Then, use the "Share" (forward) button to copy a link and distribute your simulation.

Sharing Project
STEP 1

Copyright 2026 CARLOS GUTIÉRREZ MARTÍNEZ - Creative Commons Attribution Non Commercial

Source code hosted at gitlab.fabcloud.org