kipcrossing / micropython-ad9833 Goto Github PK
View Code? Open in Web Editor NEWThis script is written in python 3.x for interfacing the AD9833 with microcontrollers with micropython (specifically the PyBoard) over SPI.
License: MIT License
This script is written in python 3.x for interfacing the AD9833 with microcontrollers with micropython (specifically the PyBoard) over SPI.
License: MIT License
Hi ,I used Raspberry Pi and set up spi and ss pins, and changed spi.send(to_send) to spi.xfer(to_send), still got error, wave.send(),An error occurred,Please guide.
My code
from ad9833 import AD9833
import spidev
import RPi.GPIO as GPIO
pin_id=7
def get_RPi_spi(mode = 0b10, lsbfirst = False):
spi = spidev.SpiDev()
spi.open(0, 0)
spi.max_speed_hz = 9600
spi.mode = mode
spi.lsbfirst = lsbfirst
return spi
GPIO.setmode(GPIO.BCM)
_ss = GPIO.setup(pin_id, GPIO.OUT)
_spi = get_RPi_spi
wave = AD9833(_spi,_ss)
wave.set_freq(14500)
wave.set_type(0)
wave.send()
print(wave.shape_type)
print(wave.freq)
Traceback (most recent call last): File "/home/a123456/Desktop/Micropython-AD9833-master/AD9833-TEST.py", line 31, in
wave. send()
File "/home/a123456/Desktop/Micropython-AD9833-master/ad9833.py", line 58, in send
self._send(0x2100)
File "/home/a123456/Desktop/Micropython-AD9833-master/ad9833.py", line 19, in send self,_send(Ox2100)
self . ss.low()
AttributeError: 'NoneType' object has no attribute 'low"
Hi , i am not able to install the pyb library. Because of this issue, i am not able to use the ad9833 ic. Please guide.
Heya Kip!
I'm having some issues with running this on Raspberry Pi Pico.
My code is:
from machine import Pin, SPI
from ad9833 import AD9833
spi = SPI(1, baudrate=9600, polarity=1, phase=0,firstbit=SPI.MSB)
ss = Pin(0, Pin.OUT, Pin.PULL_UP)
wave = AD9833(spi, ss)
wave.set_freq(14500)
wave.set_type(0)
wave.send()
print(wave.shape_type)
and I’m getting this error message:
Traceback (most recent call last): File "<stdin>", line 11, in <module> File "ad9833.py", line 57, in send File "ad9833.py", line 20, in _send AttributeError: 'SPI' object has no attribute 'send'
P.S I'm new to both Raspberry Pi Pico and Python I'm sorry if it’s a very basic question.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.