Hello Everyone. Sorry if i Disturbed anyone. I just wanted to ask on how to add a coin slot on a software button.
I've been researching for quite a while but no luck.
So i'd figured to go ask for help to the professionals.
I was only able to make the program for the software part using HC 05 and Bluetooth Terminal HC-05(got it from google store).
Any tips on how can you add a coin acceptor in this program?
T.Y.A
I Really Need Help
#include <Stepper.h>
#include<HC05.h>
#include <SoftwareSerial.h>
const int stepsPerRevolution1 = 200;
const int stepsPerRevolution2 = 200;
const int stepsPerRevolution3 = 200;
const int stepsPerRevolution4 = 200;
Stepper myStepper1(stepsPerRevolution1, A0, A1, A2, A3);
Stepper myStepper2(stepsPerRevolution2, A8, A9, A10, A11);
Stepper myStepper3(stepsPerRevolution3, 3, 4, 5, 6);
Stepper myStepper4(stepsPerRevolution4, 8, 9, 10, 11);
char junk;
String inputString="AUTOBOTS TRANSFORM!";
void setup()
{
Serial.begin(9600);
myStepper1.setSpeed(60);
myStepper2.setSpeed(60);
myStepper3.setSpeed(60);
myStepper4.setSpeed(60);
}
void loop()
{
if(Serial.available()){
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
}
Serial.println("PLEASE WAIT");
while (Serial.available() > 0)
{ junk = Serial.read() ; }
if(inputString == "1"){
myStepper1.step(2120);
}else if(inputString == "a"){
myStepper1.step(-2480);
}
inputString = "";
}
if(Serial.available()){
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
}
Serial.println("PLEASE WAIT");
while (Serial.available() > 0)
{ junk = Serial.read() ; }
if(inputString == "2"){
myStepper2.step(2120);
}else if(inputString == "b"){
myStepper2.step(-2480);
}
inputString = "";
}
if(Serial.available()){
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
if(inputString == "3"){
myStepper3.step(2120);
}else if(inputString == "c"){
myStepper3.step(-2480);
}
inputString = "";
}
}
if(Serial.available()){
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
if(inputString == "4"){
myStepper4.step(2120);
}else if(inputString == "d"){
myStepper4.step(-2480);
}
inputString = "";
}
}
}