Internet of Things, Magento and v.zero, the perfect mix for a crazy idea: a candy machine. Talk during Meet Magento Italia 2015, speaking about Battlehack Venice 2015, Braintree, v.zero, Magento, Spark Core and showing code and live demo on the stage
51. Spark Core: <filename>.ino
void setup()
{
[…]
//setup TFT
tft.begin();
//setup SD
SD.begin(SD_CS);
//setup DC Motor
pinMode(MOTOR, OUTPUT);
//Register our Spark function here
Spark.function("candy", moveMotorCandy);
[…]
}
Setting up the device
NOTE
TFT/SD: pkourany/ILI9341_SPI_LCD
Enjoy!
Tr.ID:
dfr43
@AlbertusLM@Braintree_Dev
52. Spark Core: <filename>.ino
[…]
int moveMotorCandy(String command)
{
//Adjustment to present correctly the text on the screen
String textToPrint = " Enjoy! n Tr.ID: "+ command;
//Printing the MotorMovement screen
bmpDraw("motor.bmp", 0, 0);
showTextInScreen (textToPrint,10,160);
delay(1000);
digitalWrite(MOTOR, 1); // Turn ON the motor
delay(milisecsMovingMotor);
digitalWrite(MOTOR, 0); // Turn OFF the motor
delay(3000);
setScreenToStandBy();
}
[…]
}
Expending the candies
NOTE
TFT/SD: pkourany/ILI9341_SPI_LCD
Enjoy!
Tr.ID:
dfr43
@AlbertusLM@Braintree_Dev