Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KipCrossing/Micropython-AD9833
This script is written in python 3.x for interfacing the AD9833 with microcontrollers with micropython (specifically the PyBoard) over SPI.
https://github.com/KipCrossing/Micropython-AD9833
ad9833 circuitpython microcontroller micropython micropython-board pyboard python python-3 python3 spi wave wave-generator waveform
Last synced: about 1 month ago
JSON representation
This script is written in python 3.x for interfacing the AD9833 with microcontrollers with micropython (specifically the PyBoard) over SPI.
- Host: GitHub
- URL: https://github.com/KipCrossing/Micropython-AD9833
- Owner: KipCrossing
- License: mit
- Created: 2017-03-14T04:11:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-18T23:00:58.000Z (over 5 years ago)
- Last Synced: 2024-06-11T17:27:33.907Z (6 months ago)
- Topics: ad9833, circuitpython, microcontroller, micropython, micropython-board, pyboard, python, python-3, python3, spi, wave, wave-generator, waveform
- Language: Python
- Size: 1.73 MB
- Stars: 17
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mpython - Micropython-AD9833 - Pyboard driver for AD9833, spi interface. (精选驱动库 / 功能类)
- awesome-micropython - Micropython-AD9833 - Pyboard driver for AD9833, SPI interface. (Libraries / IO)
README
# Micropython-AD9833
This script is written in python 3.x for interfacing the AD9833 with micropython microcontrollers over SPI.
## Usage
Import
```python
from ad9833 import AD9833
from pyb import Pin
from pyb import SPI
```Choose SS pin
```python
ss = Pin('X5', Pin.OUT_PP)
```Choose SPI
```python
spi = SPI(1, SPI.MASTER, baudrate=9600, polarity=1, phase=0,firstbit=SPI.MSB)
```Takes 2 arguments: sbi and ss
```python
wave = AD9833(spi,ss)
```Set the frequency
```python
wave.set_freq(14500)
```Set the wave type: 0 for sin 1 for square 2 for triangle
```python
wave.set_type(2)
```Finally, send command to the AD9833
```python
wave.send()
```You can also get some useful information
```python
print(wave.shape_type)
print(wave.freq)
```