Thanks for the replies!
I'll post my build of it with code here once I'm done! That way everyone can have one
SPI transfer is now a new arrow in my quiver, and as Crossroads said, if it is less work for the software I am all over it, since my code is already so bloated with crap for it to do.
After reading the link you provided though, I have two burning questions:
1. That 10k pulldown resistor on the "D10"/"SS"/"Slave Select" pin... is that pin 11, 12, or 14? I would LOVE to put that on my circuit- so if the power should go out and come back on, my BarBot won't start arbitrarily pouring booze on the ground!
2. Where do you buy your ribbon cable good sir? I would very much like to get my hands on some like yours.
What you suggested is exactly what I am currently doing actually, and it is very clunky for my purposes. Let me elaborate. My current code is as follows:
void pourcount(const byte shift1, const byte shift2, const byte shift3, byte ozcount)
shiftOut(data, clock,MSBFIRST, shift1);
shiftOut(data, clock, MSBFIRST, shift2);
shiftOut(data, clock, MSBFIRST, shift3);
Serial.print(F(" qtr oz, about "));
Serial.print(ozcount / 4);
Serial.println(F(" full oz."));
void pour(const byte shift1, const byte shift2, const byte shift3, byte ozcount, const int oz)
ozcount = ozcount + 1;
pourcount(shift1, shift2, shift3, ozcount);
(Notice, I AM learning from the previous suggestions to my threads, albiet slowly. I have not incorporated arrays yet... I am still learning how they fit into my master plan. Soon... Soon...)
Anyways, with the above code my usage of pour looks like:
//////////////////////// 1.Vodka on the rocks (lemon twist) /////////////////////////////////////
if (packBuff== 'V' && packBuff=='O' && packBuff=='O' && packBuff=='N')
pour(vodka1st, vodka2nd, vodka3rd, vodka, oh); End();
udpWrite( F("Vodka on the rocks- Serve with a lemon twist. Enjoy!"));
That will get very tedious and lame when pouring drinks with seven or eight ingredients. (by the way, the "oh": above is my delay time, which stands for "one half ounce") I would LOVE to find a way to make the code work like this:
pour(vodkashift, vodka, oh);
// or even BETTER would be to do
//where "vodka" in this case is a function that contains both vodkashift and the const int vodka.
//however, I have no idea how to tell a function I am creating, that I am going to give it
//a random function name as an input condition... If what I have just described doing
// (passing a function another function as an input condition) Please tell me how!
Giving all three separate latch controls IS an attractive idea... However then I would need to pass which latch pin into my input conditions of pour() right? Or could I make pour() do all the work and deduce which latch pin to utilize by using if() then() else() logic?
thanks again guys!