Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🐍 Damn Small Python compiler designed for use on Arduino for educational purposes. Based on LLVM.

License

NotificationsYou must be signed in to change notification settings

tdh8316/DSPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

158 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The new version of DSPython is now under the development indev branch!

Warning

DSPython is in the very initial stage of a development phase and should not be used in a production environment.

You can browse theexamples directory to learn how DSPython interacts with Arduino.

Are you disappointed? Please consider contributing!

DSPython - Damn Small Python

🐍 Python compiler intended to use in Arduino.

TheMicropython project aims to put an implementation of Python 3 on microcontrollers, but it is not for Arduino.

DSPython usesLLVM to provide a way to compile programs written in thePython programming language.The generated LLVM bytecode is intended to be similar to C++'s.

Accordingly,DSPython is internally not a Python at all.

Here is an example program that blinks the built-in LED of Arduino Uno:

# Blink the built-in LED of Arduino Uno!fromarduinoimport*defsetup():pin_mode(13,1)defloop():digital_write(13,1)delay(1000)digital_write(13,0)delay(1000)

To compile and upload this source, you can specify the serial port to upload by providing the--upload-to option.For example, this compiles and uploads theblink example to the Arduino:

dspython examples/Blink.py --upload-to YOUR_PORT

Supported boards

Currently, All examples have been tested only on Arduino Uno.

Usage

Installation

Requirements

  • LLVM 10 (include llvm-config)

On Windows, the official LLVM releases do not contain many important components.You have to usepre-built LLVM binary built forZiglang

  • Arduino IDE

You have to set the environment variable namedARDUINO_DIR to your arduino IDE location.This is because DSPython requires Arduino standard headers, avr-gcc compiler, and avrdude.

Building from source

Installer packages

Contributing

Contributions are more than welcome!

This is my first project using LLVM and Rust language.Please share your opinions. Any ideas would be highly appreciated!

Project goals

  • Damn small binary size
  • Support Arduino or microcontrollers
  • Programming Arduino with seemingly Python-like language

Neutral

These are not impossible, but currently not our goals.

  • Compile to other platforms
  • Garbage collector
  • Class and inheritance

Never

  • Complete Python implementation
  • Compile all python standard libraries
  • Support threading or asynchronous functions

The reason this project exists

I wanted to program Arduino in other languages as well as C++ and thought the Python language would be a good choice.That's why I decided to make a Python compiler that is available to upload directly to the Arduino.

The distinctive feature of DSP is that it uses LLVM internally instead of emittingC++.

License

Licensed under the MIT License

Copyright 2022Donghyeok Tak

Credit

About

🐍 Damn Small Python compiler designed for use on Arduino for educational purposes. Based on LLVM.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2026 Movatter.jp