How to increase frequency of strandtest.py??

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
raspferg
 
Posts: 8
Joined: Wed Mar 09, 2016 6:35 am

How to increase frequency of strandtest.py??

Post by raspferg »

Hi all,

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”