Пример #1
0
    def __init__(self, FreqAverage=5, Path="pov/", start=""):
        threading.Thread.__init__(self)

        self.datapin = 2  # GPIO-Numbering!
        self.clockpin = 3  # GPIO-Numbering!
        self.strip = Adafruit_DotStar(0, self.datapin, self.clockpin)
        # Notice the number of LEDs is set to 0.  This is on purpose...we're asking
        # the DotStar module to NOT allocate any memory for this strip...we'll handle
        # our own allocation and conversion and will feed it 'raw' data.
        self.strip.begin()  # Initialize pins for output

        self.empty_array = bytearray(60 * 4)  # prepare empty-flash
        for x in range(60):
            self.empty_array[x * 4] = 0xFF
            self.empty_array[x * 4 + 1] = 0x00
            self.empty_array[x * 4 + 2] = 0x00
            self.empty_array[x * 4 + 3] = 0x00

        self.povPath = Path
        self.povFile = start
        self.size = [0, 0]

        self.FAverage = FreqAverage
        self.actPeriod = 0
        self.freq = get_freq.freqThread(
            NAverage=self.FAverage)  # initialize frequency-thread

        self.running = False  # is Thread displaying a pov-File?
        self.NEWrunning = False  # want to stop and start new?
        self.active = True  # is Thread active? (& playing OR waiting to play) -> only False if quitting main.
        self.pause = False
        self.pos = 0
        self.loading = False  # loading? --> main waits for finishing loading-process

        if start != "":
            self.running = True
        else:
            self.off()

        self.start()
Пример #2
0
	def __init__(self, FreqAverage=5, Path="pov/", start=""):
		threading.Thread.__init__(self)

		self.datapin   = 2	# GPIO-Numbering!
		self.clockpin  = 3 	# GPIO-Numbering!
		self.strip     = Adafruit_DotStar(0, self.datapin, self.clockpin)
			# Notice the number of LEDs is set to 0.  This is on purpose...we're asking
			# the DotStar module to NOT allocate any memory for this strip...we'll handle
			# our own allocation and conversion and will feed it 'raw' data.
		self.strip.begin()	# Initialize pins for output

		self.empty_array=bytearray(60*4) # prepare empty-flash
		for x in range(60):
			self.empty_array[x*4]=0xFF
			self.empty_array[x*4+1]=0x00
			self.empty_array[x*4+2]=0x00
			self.empty_array[x*4+3]=0x00

		self.povPath=Path
		self.povFile = start
		self.size=[0,0]

		self.FAverage=FreqAverage
		self.actPeriod=0
		self.freq = get_freq.freqThread(NAverage=self.FAverage) # initialize frequency-thread

		self.running=False # is Thread displaying a pov-File?
		self.NEWrunning=False # want to stop and start new?
		self.active=True # is Thread active? (& playing OR waiting to play) -> only False if quitting main.
		self.pause=False
		self.pos=0
		self.loading=False # loading? --> main waits for finishing loading-process

		if start!="":
			self.running=True
		else:
			self.off()

		self.start()
Пример #3
0
import time
import os
from os import listdir
from os.path import isfile, join
from dotstar import Adafruit_DotStar
import get_freq

FreqAverage=5
povPath="pov/"
freq = get_freq.freqThread(NAverage=FreqAverage) # initialize frequency-thread

if os.path.isdir(povPath)==False:
	message= "Pov Path (" + str(povPath) + ") does not exist!"
else:

	all_files = [ f for f in listdir(povPath) if (isfile(join(povPath,f)) and f[len(f)-4:]=='.pov')] # find all pov-files in imagePath

	if len(all_files)==0:
		message= "No pov-files in pov Path (" + str(povPath) + ") available!"

	else:

		all_sizes=[0 for i in range(len(all_files))]
		for i in range(len(all_files)):
			f=open(povPath+all_files[i],'r')
			all_sizes[i]=f.readline()
			f.close

		convMess=""
		fileNumber=""
		times=1
Пример #4
0
import time
import os
from os import listdir
from os.path import isfile, join
from dotstar import Adafruit_DotStar
import get_freq

FreqAverage = 5
povPath = "pov/"
freq = get_freq.freqThread(NAverage=FreqAverage)  # initialize frequency-thread

if os.path.isdir(povPath) == False:
    message = "Pov Path (" + str(povPath) + ") does not exist!"
else:

    all_files = [
        f for f in listdir(povPath)
        if (isfile(join(povPath, f)) and f[len(f) - 4:] == '.pov')
    ]  # find all pov-files in imagePath

    if len(all_files) == 0:
        message = "No pov-files in pov Path (" + str(povPath) + ") available!"

    else:

        all_sizes = [0 for i in range(len(all_files))]
        for i in range(len(all_files)):
            f = open(povPath + all_files[i], 'r')
            all_sizes[i] = f.readline()
            f.close