Post about your Basic project here

Moderator: Mmiscool

User avatar
By Electroguard
#53626 Just to let you know that I'm already working on it forlotto, but it's going to take me several days to create the various pics and audio examples etc for posting up.

I also want to progress the original 'proof-of-concept' examples into more useful real-world programs by adding a FIFO queue.
There shouldn't be a problem using the 6500's BUSY signal to trigger an Interrupt routine to keep sending the next filename from the ESP queue until the queue is eventually emptied, but ESP_Basic arrays are something I haven't looked into yet.

By way of example, consider the sequence of audio files needing to speak the devices IP address...

FILENAME AUDIO MESSAGE
100 "This I P address is"
001 "one"
009 "nine"
002 "two"
101 "dot"
001 "one"
006 "six"
008 "eight"
101 "dot"
004 "four"
101 "dot"
001 "one"

There's no problem getting the program to serially issue all the relevent filenames to play in sequence, but it can't just send them all immediately one after the other else they will all splatter over the previous files before they get a chance to play.

You mentioned arrays, therefore I'm hoping you've already dabbled with them in ESP_Basic, and perhaps may have some time-saving ideas or suggestions of how I might create a First In First Out queue for temporarily 'pushing' and 'pulling' 3 digit filenames into?
User avatar
By forlotto
#53636 No but recall looking into a while back. It was lacking 2D array functionality if memory serves correct.

Possibly something like this would work.

Code: Select alldim s$(100) as string
s$(0) = "ONE"
s$(1) = "NINE"
s$(2) = "TWO"
s$(3) = "DOT"
s$(4) = "ONE"
s$(5) = "SIX"
s$(6) = "EIGHT"

n = 6
for i=0 to n
delay 10000
song2play = ( s$(i) , 2)
gosub [playit]
next i
undim s$
return
[playit]
Your sub to play things via serial.
return


first in first out don't know how well it would work as first in first out you would have to do a for loop to catch each variable as it were to come in to play. So possibly you could just catch them with variables of your own as they come down the pipe ... I also don't know if things like redim are possible with basic as well or how to remove / add strings individually I would assume it is just dim and the number and info to add and undim and number and info to remove not entirely sure on this. Very little documentation on arrays.

Things may have changed a bit since looking at them in v2 but a rough guess.

Limited on quite a bit on this as nothing yet except for a timer has called upon necessity for this. Not ready for diving into the timer thing quite yet. Just finished up new v3 light dimmer and have it operational and in place along with the android application last night that was fun. Hardware and software is way better than first iterations so ... improvements are like baby steps.

Hope this helps.
-forlotto