I dropped the #include <time.h> since the compiler could not recognize it. Instead I followed the example provided in this link:
The four error messages are:
/workspace//src/blackjack.cpp:8:15: error: unable to find numeric literal operator 'operator"" bc6ae35b54915b4591cd0b994c27a'
void setupMatrix ( void *mat );
^
/workspace/lib/blynk/src/Blynk/BlynkHandlers.h:21:13: error: expected unqualified-id before numeric constant #define V2 2
^
/workspace/lib/blynk/src/Blynk/BlynkHandlers.h:21:13: error: expected ')' before numeric constant #define V2 2
^
/workspace//src/blackjack.cpp:216:32: error: no matching function for call to 'WidgetLCD::print(const char [12])'
}
^
I don't know how to resolve all the above errors. How do I declare two push buttons on Blynk? And also, I'm not sure how to print the strings in decideWinner function to the LCD terminal of Blynk.
I think the last error has to do with lcd.print("It's a draw"). In your other calls to lcd.print, you pass two ints and a string, and I think that is necessary.
A usual Blackjack Dealer's Shoe is filled with 1 to 8 decks of 52 cards so in each round of 52 to 416 cards each number can only appear a limited number of times. A normal random generator would not heed this restriction, so you'd need to add some logic to do this yourself.
BTW, there is no Ethernet connectivity on any of the Particle devices (unless you attach one) and hence there is no Ethernet.h (unless you import the library for the extra hardware).
And since there is no Ethernet, there will be little use in including BlynkSimpleEthernet.h either, IMO.
Particle devices are all about wireless, so you should look in that direction.
(Update: I see I was a bit late to the party and most of the questions were already dealt with )
Also, I'm just designing this to be a 1 player version versus the "computer", so would a deck of cards suffice? It would be great to scale this up to include more players, but for now I hope to get the 1 player version working to meet next week's deadline.
@ScruffR I’m not sure at all. I’m just guessing here. I assumed that WidgetLCD lcd(V1) is to declare Virtual Pin 1 in Blynk, since I’m having two buttons it made sense for me to declare (V2) as well.
Nope, WidgetLCD lcd(V1) creates a WidgetLCD object named lcd which is tied to the virtual pin V1 but V2 does not belong anywhere here.
You could declare another WidgetLCD other(V2) but what do you actually intend to do with V2?
Do you actually want those virtual pins tied to an WidgetLCD object?
@ScruffR Oh I see that I’m mixing up LCD with the push buttons. Major brain fart… Yeah, so I’m clear on all this now. I do not need to declare the virtual pins for the push buttons as I did for LCD, as I had declared them under BLYNK_WRITE, yes?
@ScruffR Thanks for all your help so far. I’ve looked at the basic sketches, and they do not seem to be very helpful to me. The sketch of interest to me is this:
I think it would work though if I declared int pinDataV1 and pinDataV2 as global variables. But maybe this question is better suited for the Blynk community.
@ScruffR Something is not working, when I flashed the code to my Photon, no numbers show up on the LCD screen of my Blynk app. The status of my Photon is online on the Blynk app though.
Is it something minor, or the whole code logic is just wrong? (I really hope not! )
Also, I’m wondering how this program is terminated, since I didn’t write any functions after decideWinner. Must I add something after this?
Edit: Some parts of the program are working, after pressing the HIT and STAND button randomly, the line It's a draw appers on the LCD widget. But after that, nothing seems to be happening. I can’t figure out what the program is doing. Does in continue the process over and over again in the loop function?