I am using strandtest.py for RPi (2B) to modulate (OOK) a single DotStar LED and using the code below can get about 2.5KHz. My ON time is ~240uS. I'm using MOSI and SCLK pins.
Is there a way that I can increase the frequency to >100KHz?
what are my limitations??
CODE:
Code: Select all
import time
from dotstar import Adafruit_DotStar
numpixels = 10 # Number of LEDs in strip
strip = Adafruit_DotStar(numpixels, 32000000) # SPI @ ~32 MHz
strip.begin() # Initialize pins for output
strip.setBrightness(255) # brightness
head = 0 # Index of first 'on' pixel
tail = -10 # Index of last 'off' pixel
color = 0xFFFFFF # 'On' color (white)
while True: # Loop forever
strip.setPixelColor(head, color) # Turn on 'head' pixel
strip.setPixelColor(tail, 0) # Turn off 'tail'
strip.show() # Refresh strip
time.sleep(1.0 / 1000000) # Pause
head += 1 # Advance head position
if(head >= numpixels): # Off end of strip?
head = 0 # Reset to start
tail += 1 # Advance tail position
if(tail >= numpixels): tail = 0 # Off end? Reset