Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

SkyPascal

An experimental drone project powered by Arduino and programmed with FreePascal

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

SkyPascal - Drone Project (FreePascal Firmware)

A drone project using FreePascal for Arduino firmware development

Project Structure

pascal
skypascal/
????????? firmware/          # FreePascal drone firmware
????????? libraries/         # Custom FreePascal libraries for Arduino
????????? common/            # Shared units and utilities
????????? schematics/        # Circuit diagrams and hardware documentation
????????? docs/              # Project documentation
????????? README.md

Overview

This project demonstrates how to develop Arduino drone firmware entirely in FreePascal, bypassing the traditional C/C++ Arduino development environment. We use FreePascal's embedded capabilities to directly program the Arduino microcontroller.

Why FreePascal for Arduino?

  • Type Safety: Strong typing helps prevent common embedded programming errors
  • Readable Code: Pascal syntax is more readable and maintainable
  • Modern Language Features: Object-oriented programming, units, and modularity
  • Cross-Platform: Same language for firmware and ground station (if needed later)
  • Memory Management: Better control over memory usage in constrained environments

Components

Firmware (firmware/)

  • Main flight controller logic
  • Sensor interfacing (IMU, GPS, barometer, etc.)
  • Motor control and ESC communication
  • Communication protocols (Serial, SPI, I2C)
  • Safety systems and failsafes
  • Real-time control loops

Libraries (libraries/)

  • Arduino hardware abstraction layer in Pascal
  • Sensor driver libraries
  • Communication protocol implementations
  • Mathematical utilities (PID, Kalman filters, etc.)
  • Hardware-specific drivers

Common (common/)

  • Shared data structures
  • Protocol definitions
  • Utility functions
  • Configuration management

Getting Started

Prerequisites

  1. Free Pascal Compiler (FPC) with embedded target support
  2. AVR Cross-Compiler Tools (avr-gcc for linking only)
  3. AVRDUDE for flashing firmware to Arduino
  4. Arduino Hardware (Uno, Nano, or compatible AVR-based board)

Hardware Requirements

Basic Drone Components:

  • Arduino-compatible flight controller board
  • IMU sensor (MPU6050/MPU9250 or similar)
  • GPS module (optional)
  • Barometric pressure sensor
  • Motors and Electronic Speed Controllers (ESCs)
  • Propellers
  • Battery and power distribution
  • Radio receiver (for manual control)

Development Workflow

  1. Hardware Setup: Connect sensors and components to Arduino
  2. FreePascal Development: Write firmware in Pascal
  3. Compilation: Compile to AVR machine code using FPC
  4. Flash: Upload firmware to Arduino using AVRDUDE
  5. Testing: Ground testing with safety measures
  6. Flight Testing: Controlled flight tests

License

This project is open source. Please check individual files for specific licensing terms.

Contributing

Contributions are welcome! Please focus on:

  • FreePascal code quality and best practices
  • Safety improvements
  • Hardware compatibility
  • Documentation and examples