helloanimesh390
Published © CC BY

DIY Arduino Coin Eater | Coin Bank

Make your own Arduino coin eater/bank. A DIY Arduino idea.

BeginnerProtip5,217
DIY Arduino Coin Eater | Coin Bank

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

ARDUINO CODE

Schematics

NOT AVAILBLE

visit link to see diagram

Code

ARDUINO CODE

Arduino
#include <Servo.h>



Servo myservo; // creating myservo object
int buttonPin = 11;//set button pin
int buttonState = 0; // set buttonState 

void setup()
{
  myservo.attach(12);// attach the 13 pin to servo
  pinMode(buttonPin, INPUT); // set button to input
}


void loop()
{
  
  buttonState = digitalRead(buttonPin); // read and save to the variable "buttonState" the actual state of button 
  
  if (buttonState == HIGH)
  myservo.write(0);
  
  else
  myservo.write(95);
  delay(1500);
  // IF YOU LIKE THIS PROJECT PLEASE SUBSCRIBE ; https://www.youtube.com/channel/UCk9UflimfCIAv7kdAWBxyuA
  
}

Credits

helloanimesh390
9 projects • 14 followers

Comments