|
1067
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple queue buffer
|
on: November 25, 2010, 01:07:37 am
|
|
That also looks very interesting,
So if I get a signal from my decoder,say "int door" which I convert from bcd to dec, how do I imput it to the routine
fifo.enqueue = door; ?
and to get the first queued number out
resultant = fifo.dequeue; ???
|
|
|
|
|
1068
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple queue buffer
|
on: November 24, 2010, 04:12:25 pm
|
|
I also have just one number coming in every minute , or ten minutes, or perhaps two different ones in 2 seconds,
It must play that first numbers audio, and wait for the next, or take from the queue if something came in while it was playing..............
|
|
|
|
|
1069
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple queue buffer
|
on: November 24, 2010, 02:26:54 pm
|
|
The other problem might be that I want to add this code to the micro that does the lookup and refresh of the video shift registers every 20 uS, so I think I should perhaps do this with an interrupt routine so that it doesn't run every loop? just when a new command comes in.........?
Or I can do it on the other chip that does the SD card reader and DA with the waveHC library, but I did get the idea that it was also pushed for time ???
|
|
|
|
|
1073
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple queue buffer
|
on: November 24, 2010, 10:17:11 am
|
Thanks Paul, Whoops,, I have obviously bitten off more than I can chew here, despite my wonderful 3 stars, I am still a newbie, and nowhere near on that page yet  . I was so chuffed when I synced the overlay to the vga, but thats more in my realm of experience. My software is very crude , and I am moving one step at a time through the Arduino experience. and having progressed past the flashing LED, your post has bought me crashing back to earth ! ;D Perhaps I will stick 8 shift registers in parallel and clock it through 
|
|
|
|
|
1074
|
Forum 2005-2010 (read only) / Syntax & Programs / simple queue buffer
|
on: November 24, 2010, 09:02:07 am
|
I seem to have hit a wall trying to understand some of the queuing examples a search threw up, I have a decoder giving a 1 - 9 integer output called outdoor. I want to announce this number from my waveHC SD card reader , and display this number on the HD vga overlay screen for the duration of the announcement (wave.isplaying) The audio and video sections are working fine, but I just have to control them from a simple queueing routine. If I have 6 queueing positions Q1 to Q6, would something like below work? if (Q1 ==0) { Q1 = outdoor; } // put number into first empty Q position else if (Q2 ==0) { Q2 = outdoor; } else if (Q3 ==0) { Q3 = outdoor ; } else if (Q4 ==0) { Q4 = outdoor ; } else if (Q5 ==0) { Q5 = outdoor ; } else if (Q6 ==0) { Q6 = outdoor; }
exit=Q1; // number to display/announce
playshow () // routineto display and announce the exit number "exit"
int i = digitalRead ( playingPin ); // from wave.isplaying from the sd card if (i== LOW ) // when its finished first announcement { Q1 = 0; }
if (Q1 == 0)
{ Q1 = Q2; Q2=Q3; Q3=Q4; Q4=Q5; Q5=Q6; } // shift all down the queue
|
|
|
|
|
1075
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple countdown timer
|
on: November 23, 2010, 10:47:50 am
|
|
Those boxes look really space age, we have a company called Plastics for Africa here that has all sorts of boxes, I will have a look with a new eye when I get a chance. I was wondering how you balance the current through the LEDs in the same segment if they are in parallel, but I think nowadays the Vf is pretty matched in a batch when you buy them ,and I can't see much difference in your photos. Your sport certainly seems to lend itself to electronics ( right back to the days of the Russian guy disqualified at the Olympics :-) It must have been hard for a judge to see who hit who first before electronics! My wife plays lawn bowls, not much scope ( or lightning speed ) there..
The TPIC6B595 is cheap, although it has no current limiting, but I find a resistor to each segment makes the track layout so much easier, its like a free jumper ( I waste hours trying to layout my boards without jumpers just due to pride, I should just let the autorouter do its untidy best )
|
|
|
|
|
1076
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple countdown timer
|
on: November 22, 2010, 12:32:28 pm
|
|
There's none so blind as they that do not Google !
Perhaps I should look into a fencing scoreboard when I catch up !
I have never tried LEDs in parallel, does each have its own resistor? I don't see any on the pics. The enclosures look very interesting , what are they sold as ?
I have a day job as well, and thats where I am finishing off a vga overlay unit that also has an announcer with the SD card, which was my third arduino project, I now have to get both cards to queue in case several buttons are pressed while the first is playing ... keeps me off the streets !
|
|
|
|
|
1077
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple countdown timer
|
on: November 22, 2010, 11:01:38 am
|
That's an interesting project, I don't know if anyone fences here in South Africa, perhaps I can put some micro-switches in the Zulu fighting sticks... Sounds quite a complicated system, I definitely wouldn't try all that with cmos ! I have been doing mainly cricket, hockey, basketball and soccer/rugby boards, www.scorebauds.co.za and had my little niche of 7 segment numerical only displays, but it was when demand made it that I had to have team names as well that I looked at micros and found Arduino. I am still using the Holtek ht12 remote chip for the encoding/decoding, and can handle up to 32 digits with one chip, but now I want to do some real comms. I like the idea of using the Tone example for the sounder, I have had hassles with hooters and piezo things, so perhaps I will have a small 20 watt amp and a horn speaker. It would be nice to record the traditional horn sound at the end of a rugby match here, and save it as a wav file perhaps? Good luck with your fencing device, I would like to see the photos when its done.
|
|
|
|
|
1079
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple countdown timer
|
on: November 21, 2010, 10:02:18 pm
|
Wow, what are you paying for the MAX7221 there btw ? ( the TPICs I bought 100 of for that price ) It sounds like the way to go when I eventually drag myself into the 21st century  I also saw that some of the chips available test for open and short circuit LEDs, and you can even fine tune the brightness to match LED batches - wonderful stuff. Samples would be nice if I knew I could get a better price if I switched to the chips, but its a bit of a commitment having boards made etc. ( I must fit my dremel to my first Arduino project ( a 2 axis machine ) and make my own prototype boards ) Look at that,  I am nesting brackets in paragraphs since I found it works for switch / case functions
|
|
|
|
|
1080
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: simple countdown timer
|
on: November 21, 2010, 02:09:33 pm
|
One reason I want to use 4 of the TPIC6B595s is that I get them for less than 50 cents US, whereas the MAX7221 is over $12 there , so probably over $20 by the time I got it here. I am also using 4 chips because I want to avoid multiplexing the displays, ( I latch them ) This is a hangover from my existing scoreboards, where I get incredible range on the Radiometrix 433 Mhz link. The link is as near to perfect as you can get, line of sight, across a field, to a receiver with an antenna mounted high, and nowhere near any interference or buildings. I did experiment with adding a multiplexed text display and it severely reduced the range that the remote would work, so its no sweat latching the displays. There are some practical reasons too, but I might try it again when I get all my current projects wrapped up. I have read that some of the better mux chips round off the switched waveforms to the LEDs to reduce the interference, but at the moment I have a simplex link with no error checking ( apart from repeating the data three times and compare it ) and it is working very well. Thanks for the code though, the data link will be my next challenge in modernising my systems
|
|
|
|
|