Skip to content

My driver Pen Ploter Machine written in C library (Open for You) πŸŒ±πŸ–ŒοΈ ♑⁠(⁠Ӧ⁠v⁠Ӧ⁠q⁠).

Notifications You must be signed in to change notification settings

zerobchan/MoonBerry-Painter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ™ MoonBerry-Painter

Pen Plotter Driver Library β€” Written in C (Open for You)

πŸŒ±πŸ–ŒοΈ β€œDraw the world in code and ink.” ♑⁠(⁠Ӧ⁠v⁠Ӧ⁠q⁠)

Logo

MoonBerry Painter


🧩 Overview

MoonBerry-Painter is a lightweight and high-performance C-based driver library for controlling pen plotter machines. It is designed with real-time precision, low-latency GPIO control, and modular adaptability β€” making it suitable for both embedded systems and desktop environments.

Whether you’re building your own drawing robot, testing motion control algorithms, or integrating plotting into your automation workflow β€” MoonBerry-Painter gives you the tools to paint with hardware precision.


✨ Features

βœ… Successfully implement 🌱 Growing implement 🌸 Customizable implement

Feature Description Status
πŸͺΆ Pure C Implementation No runtime overhead, just efficient C code. βœ…
βš™οΈ Low-Latency GPIO Driver Optimized for real-time pen plotting control. βœ…
🧠 Configurable Axis System Supports multiple stepper motor axes (X, Y, Z, etc.). βœ…
🎨 Path & Curve Interpreter Converts paths or vector data into motion commands. πŸ§ͺ
πŸ”Œ Teensy / Raspberry Pi Support Works with both microcontroller and SBC environments. βœ…
🧰 Modular I/O Layer Easily adapt to your own hardware interface. βœ…
🧾 Logging & Debug Mode Built-in serial and runtime logger for debugging. βœ…
πŸͺ΄ Open & Extendable Fully open for customization, integration, and learning. 🌸
πŸ–‹οΈ Svg Preview and Svg Render converting Fully compatibility convert vector format. 🌱

πŸš€ Getting Started

🧱 Prerequisites

You’ll need:

  • C Compiler (GCC / Clang / ABCC / etc.)
  • Make or CMake (optional)
  • Access to GPIO (for Raspberry Pi / Teensy/Arduino)
  • Basic knowledge of C and embedded I/O
  • Hobbyst custom or DIY pen plotter hardware printing math with super highly precision curve and shapes

βš™οΈ Building from Source

# Clone the repository
git clone https://github.com/archanaberry/MoonBerry-Painter.git
cd MoonBerry-Painter

# Build using GCC
gcc -o moonberry main.c src/*.c -Iinclude -lm

If you use CMake:

mkdir build && cd build
cmake ..
make

🧩 Example Usage

#include "moonberry.h"

int main(void) {
    mb_init();
    mb_set_pen(UP);

    mb_move_to(0, 0);
    mb_set_pen(DOWN);
    mb_draw_line(0, 0, 100, 50);

    mb_set_pen(UP);
    mb_shutdown();
    return 0;
}
; MoonBerry Painter Script
; Converted from C example

INIT                ; set up system (equivalent to mb_init)
PEN UP              ; mb_set_pen(UP)

MOVE X0 Y0          ; mb_move_to(0, 0)
PEN DOWN            ; mb_set_pen(DOWN)
DRAW X100 Y50       ; mb_draw_line(0, 0, 100, 50)

PEN UP              ; mb_set_pen(UP)
SHUTDOWN            ; mb_shutdown
END

🧬 Architecture

MoonBerry-Painter
β”‚
β”œβ”€β”€ core/              β†’ Motion control & GPIO abstraction
β”œβ”€β”€ backend/           β†’ Hardware drivers (Teensy, Raspberry Pi, etc.)
β”œβ”€β”€ driver/           β†’ OS Driver Hardware for Linux Windows or Microcontroller OS.
β”œβ”€β”€ parser/            β†’ Command & vector interpreter
β”œβ”€β”€ include/           β†’ Public headers
β”œβ”€β”€ scripts/           β†’ For etc, or python plugin
└── examples/          β†’ Usage demos & test code

Each module is isolated and can be replaced with your own driver backend or logic layer.


🧠 Design Philosophy

MoonBerry-Painter follows the β€œOpen Core, Modular Edge” principle:

  • The core provides stable, clean abstractions for motion control and I/O.
  • The edges (drivers, parsers, extensions) are replaceable β€” you can make it yours.
  • Code simplicity and readability are prioritized over over-engineering.

πŸ§ͺ Hardware Compatibility

Platform GPIO Type Supported Notes
Raspberry Pi BCM / sysfs / memory-mapped βœ… Recommended for prototype
Teensy Native I/O βœ… Best latency
Arduino via serial link βš™οΈ Experimental
Custom Board Custom driver interface 🧩 Extend with your own driver

πŸ› οΈ Configuration

You can configure machine parameters via a simple header file or runtime config:

#define MB_AXIS_X_STEPS_PER_MM 80
#define MB_AXIS_Y_STEPS_PER_MM 80
#define MB_FEEDRATE_DEFAULT   1200
#define MB_PEN_DOWN_DELAY_MS  50
; MoonBerry Painter runtime setup
CONFIG AXIS X.STEP_PER_MM 80
CONFIG AXIS Y.STEP_PER_MM 80
CONFIG FEEDRATE 1200
CONFIG PEN.DELAY 50

; Ready to draw
INIT

Or load via configuration file (optional support planned).


πŸ§‘β€πŸ’» Development

Contributions are welcome! Feel free to fork, modify, or extend modules such as:

  • backend/teensy_gpio.c for microcontroller support
  • path.c for vector data decoding

πŸ“œ License

ABPL License This project is open-source and free to use in any personal with berry personality or commercial project (With berry permission) β€” just give credit if possible. πŸŒ±πŸŒ™


πŸ’¬ Contact & Community

🌸 MoonBerry-Painter β€” where hardware meets art.

About

My driver Pen Ploter Machine written in C library (Open for You) πŸŒ±πŸ–ŒοΈ ♑⁠(⁠Ӧ⁠v⁠Ӧ⁠q⁠).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •