Git Product home page Git Product logo

micropython-ad9833's People

Contributors

kipcrossing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

micropython-ad9833's Issues

I changed to use raspberry pi, but still got error, please guide.

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"

Issue with Raspberry Pi Pico

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.