Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eiichiroito/mpytools
MicroPython tools for Pharo Smalltalk
https://github.com/eiichiroito/mpytools
esp32 esp8266 micropython pharo smalltalk
Last synced: 27 days ago
JSON representation
MicroPython tools for Pharo Smalltalk
- Host: GitHub
- URL: https://github.com/eiichiroito/mpytools
- Owner: EiichiroIto
- License: mit
- Created: 2021-09-27T07:35:19.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T12:12:03.000Z (about 2 years ago)
- Last Synced: 2023-03-01T14:41:01.151Z (almost 2 years ago)
- Topics: esp32, esp8266, micropython, pharo, smalltalk
- Language: Smalltalk
- Homepage:
- Size: 381 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MPyTools
MicroPython tools for Pharo Smalltalk[![Build Status](https://app.travis-ci.com/EiichiroIto/MPyTools.svg?branch=master)](https://app.travis-ci.com/EiichiroIto/MPyTools)
MPyTools is a tool for developing application of MicroPython devices using Pharo Smalltalk.
It consists of following tools.
* Communication tool which interacts with MicroPython devices.
* Generator tool which generates MicroPython codes from Smalltalk class.You can make MicroPython application using Pharo System Browser, and then check it by transfering it to MicroPython device directly.
## Acknowledgement
This project is inspired from MicroSqueak and rewrited some codes in Pharo Smalltalk. (https://web.media.mit.edu/~jmaloney/microsqueak/)
# MPyTool
MPyTool communicates with MicroPython devices through a serial port. It sends MicroPython expression and receive its response, also it supports for uploading and downloading files.## Usage
```Smalltalk
| mp |
mp := MPyTool new.
mp useSerial.
(mp evaluate: '1+2') inspect.
``````Smalltalk
MPyTool new
useSerial;
upload: 'print("Hello")' fileNamed: 'main.py'.
```# MicroPythonCoder
MicroPythonCoder generates MicroPython code from a method or methods of a class.
For example, a code in Smalltalk,```Smalltalk
helloWorld
self isFunction: true.
self print: 'Hello, World!'
```It is converted into the following MicroPython code.
```Python
def hello_world():
print("Hello, World!")
```There are several types of devices using MicroPython. Currently MicroPythonCoder supports only ESP8266/ESP32 and micro:bit devices. See samples.
## Usage
To get MicroPython code of a class, send #asMicroPython message to the class.```smalltalk
ESP8266Sample asMicroPython
```To execute whole the class in a device,
```smalltalk
MPyTool new
useSerial;
execute: ESP8266Sample asMicroPython.
```To store the code as a 'main.py' file,
```smalltalk
MPyTool new
useSerial;
upload: ESP8266Sample asMicroPython fileNamed: 'main.py'.
```# MPyToolGUI
![Screenshot1](https://raw.githubusercontent.com/EiichiroIto/MPyTools/master/images/screenshot1.png)
## Usage
```Smalltalk
SpMPyTool new open
```# Installation
```smalltalk
Metacello new
baseline: 'MPyTools';
repository: 'github://EiichiroIto/MPyTools/src';
load.
````