Overview
Do you ever feel like someone or something is watching you? In the case of this project, it is! You can use a Fruit Jam running CircuitPython with a USB webcam to display monster eyes that gaze in the direction of motion captured by the webcam. The CircuitPython code utilizes Turbo helper modules to speed up tasks like drawing the monster eyes and checking for new motion in the camera frames.
What's the Deal with Turbo?
CircuitPython Turbo lets you write Python helper modules with Viper decorators from MicroPython. These modules are compiled using mpy-cross for the specific architecture of the chip that it will run on. This creates an .MPY file that goes into the /lib folder on your CIRCUITPY device. The functions that utilize Viper decorators become native machine code on compilation. Not everything benefits from Viper decorators, but code snippets that use heavy math computations, like graphics, see a significant speed-up.
Tim C. wrote an excellent explainer for how Viper modules are written in his PixelDust Digital Sand for CircuitPython Guide:
Viper functions are written as Python, but they are their own weird flavor of Python with an extra set of rules that must be followed.
Local variables and arguments must be
int,uint(32-bit only),bool,ptr,ptr8,ptr16,ptr32, orobject. They cannot usefloatslike normal Python numbers do. Parameters get passed to the Viper function as a list of values, and are accessed via their index within that list. There is no overflow protection. Integers will silently wrap, out-of-range indexes can corrupt memory or crash instead of raising a cleanIndexError. Variables cannot change types. Mixing of typed values withobjectvalues will fall back to slower runtime calls.
Page last edited October 14, 2026