Raspbery Pi based Arcade Machine FTC Payment Proof of concept
-
Very excited.
I think I’ve got everything read to test stage 2 of the project, just need to load some ftc onto my phone and do the video, video may be up later tonight or tomorrow night.
I’ve also added some extra code as I realised if the API was not contactable when the Pi first started after the API comes online it would put free credits on the machine.
This problem is now fixed
-
Stage 2 tested, and the video on youtube.
This time I sent enough for 2 credits to show you can pay for more than one credit at a time and it will just count then down and add them to the machine.
Here is the link to the Video.
I’ll put the code up on GitHub tomorrow
-
Looks fantastic Tony! You are really fast developer ;)
-
It helps when the whole thing is less than 100 lines of code.
I’ve only just started to learn Python, but I can see why everyone says its great for fast development
-
Wow that’s looking great. That’s some fast progress well done!!
-
“Computer says No!” awww mate, that was a brilliant touch, possibly funniest thing this week ^-^
And Yes Mr Davison, there are some good things to be found today ;)
-
Yes I had great fun adding ‘Compu’er says No’, far more amusing than just ‘Offline’ :)
-
“Computer says No!” awww mate, that was a brilliant touch, possibly funniest thing this week ^-^
And Yes Mr Davison, there are some good things to be found today ;)
Ha ha yes I told you all was not lost!
-
It occurred to me, to make it easier for main stream to what to use cryptos I should possibly make the arcade payment device allow the owner to set a price in their local currency they want a credit to cost rather than in FTC.
That way if the value of FTC shifts against their local currency they dont have to worru as it will dynamically adjust the price in FTC.
I think rounding it to the nearest whole FTC would be advisable to keep payment simple though.
This will radically change the way it all works though as it means it would need to generate the QR codes on the fly as value changes and require a new module to get the price of FTC against the local currency, but I think is acheiveable without too much extra work.
What does everyone think?
Is this a worthwhile feature?
Should I also leave the option to just have a set FTC value too?
-
More progress.
You now have the option to set the cost per credit in FTC, or in any of the currencies the API supports and on power up it will look at the exchange rate and set the credit price to the nearest whole FTC equal to the value set in Fiat.
Now comes the fun part to get it to generate the QR code based on the credit price and get it to also display the price in words and the feathercoin logo.
I know how to make it generate the QR code and to just display that, but will need to learn some python Graphics functions to get the rest togerther.
-
Very Happy
As stated above you can now set credit cost just as a FTC price, or in any local currency supported by the API and it will round it to the nearest whole FTC, it then creates a QR code based on this price, adds that to a white background on the right, adds the Feathercoin logo on the top left and text detailing the cost per credit in FTC.
So to change the price per credit all you need to do is alter the text value in the main program.
I’m debating on whether to add a cheap IR sensor so I can have a screen saver run that when it detects movement will turn back on the display for 2 minutes, but I think tomorrow I will release the coed of what I have done
-
Sounds great, everybody still think in fiat anyway.
This will be success.
We will continue your story in newsletter #35.
-
Yeah that’s some speedy progress. Love the fiat conversion option.
-
Following this closely.
-
It’s all up on Github now
https://github.com/tmuir12/FTC_Arcade_Pay
If you happen to already own the ADAfruit 320 x 240 LCD display for the raspberry pi, please download it, give it a try, try to beak it and give me feedback to improve it.
Thanks
-
Time to start Version 2 of the arcade machine.
The main difference with version 2 is it will have the blockchain on the pi itself, so it does not need to rely on an API elsewhere to check if FTC has arrived to give credit.
I also plan to add the option to allow discounts for multiple credit purchases at once and I’m sure I’ll come up with other ideas as I progress.
Here is a very basic functional description of how it will work.
'These are set by the arcade owner in code
Cost per credit is set in code either in FTC or local fiat
Option to give discount for 3 or more credit is enabled or not in code
Percentage discount for 3 or more credits is entered in code
Account number to send the received FTC to
Balance at which FTC is transferred to other account
Pi will be running feathercoind in the backgroundCode basic functional description
Get cost in Fiat Per Credit
check if discount for multiple credits is given (discount for 3 or more credits)
If yes get percentage discount
Convert Full price and discount price if used to FTCCheck if blockchain is up to date, if not wait until it is
Display price per credit and discount for multiple is selected
Allow use via touch screen to select how many credits he wants to buy
Keep checking wallet is up to date and if it gets more than 4 blocks behind display offline message to caught back up
Work out total cost in FTC for selected credits applying discount is more than 3 chosen and discount enabled
Create account number
Create QR code for account number with total FTC required
Display QR code and total in FTC for number of credits
Start checking account every 15 seconds to see if deposit has arrived
Display option to cancel transaction inbetween checks to go back to main screen to allow credit selection to be done again
If correct amount appears in account give credits equal to the amount required
If amount is short display how much it is short by and ask difference to be sent
If total amount received is less that 3 full priced credits give credits at full price up to amount received
If total amount received is more than 3 credits, give credits at discounted price up to amount received
Continue to check for difference and credit remaining credits owed when balance is received
Continue to give the option to quit back to main screen noting unused balance will be lost
Return back to main screen showing cost per credit and discount if usedSend balance to another account once balance gets above a predefined level
I can reuse some of my code from the first version, but a lot will have to be rewritten