Programming GuideΒΆ
Zerynth scripts are developed in Python 3.4. Most of the Python Standard Library functions, types and operators are available also in Zerynth, some high level processing features have been removed because not usable in embedded setups and also to reduce the VM dimension allowing the embedded porting. Differences from Zerynth and Python 3.4 standard library are reported in VM Guide.
The following guide is consequently an adaptation of Python 3.0 official standard library guide that can be used for Python syntax, types, operators and constants details and use.
The “Python standard library” contains several different kinds of components. It contains data types that would normally be considered part of the “core” of a language, such as numbers and lists. In addition, the Zerynth library also contains a set of builtins that can be used in Zerynth scripts without the need of an import statement.
The bulk of the library, however, consists of a collection of modules (that require import to be used in scripts). Some modules provide interfaces that are highly specific to Zerynth, like managing threads and the board’s hardware and peripherals and connections; some other provides interfaces that are specific for particular sensors, shields and auxiliary boards.
This manual is organized “from top to bottom” it first describes how to start with Zerynth, then shows you some examples and finally goes in details with description of Zerynth built-in functions and modules.
Let the show begin!
Contents:
- Python Basics
- Sequences and Map Types
- Pin Mapping and Naming
- Standard Library
- Zerynth Builtins
- Math
- GPIO
- Analog to Digital Conversion
- Pulse Width Modulation
- Input Capture Unit
- DAC
- CAN
- Hardware Timers
- I2C
- SPI
- Garbage Collector
- Streams
- Threading
- Software Timers
- WiFi
- GSM
- BLE
- BLE Beacons
- Ethernet
- JSON
- CBOR
- MsgPack
- Sockets
- Requests
- Urlparse
- Fifo
- Queue
- Flash
- Operating System
- fatFS
- SpiFlash
- QSpiFlash class
- SpiSD
- MCU
- VM
- Secure Socket Layer
- Firmware Over the Air update (FOTA)
- Power Management
- Secure Firmware
- Cryptography
- Bignum
- Base64
- JSON Web Tokens
- Struct
- Real-Time Clock
- X509
- NTPClient Library
- C Language Interface
- Virtual Machine
- Examples
- Hello Zerynth
- Blink
- Digital Read
- Analog To Digital Acquisition
- Analog To Digital Voltage Conversion
- Oscilloscope
- Serial Port Read-Write Basics
- Sensor Driven Multi Blink
- Multi Thread Basic
- Multi Blink
- Serial Port Read-Write Advanced
- Input Capture Unit
- Timers Basics
- Strings Format
- CAN Auto-baudrate
- Can Bus Example
- Dac Basic
- Buzzer with PWM
- PWM Fade
- InfraRed Raw Capture
- Timers Advanced
- Queues
- Interrupts
- Interrupts Debounce
- Exceptions-Debugger
- Math
- Mini Web Server
- UDP Pinger
- UDP NTP Time
- Wifi Scan
- HTTP Time
- HTTP Weather
- HTTP Methods
- Secure HTTP
- ntp client
- RTC Keep Time
- Resources
- Struct
- Flash Internal
- SpiFlash
- QSpiFlash
- SpiSD
- Filesystem
- MCU Reset
- C Language Interface
- Crypto Hash
- Crypto ECC
- Powersaving
- Watchdogs
- VM Exceptions
- VM HardFault