[Edit - moderator - please use the 'code' button when submitting code]
Code: Select all
#include <AFMotor.h>
AF_DCMotor motor1(1, MOTOR12_64KHZ);
AF_DCMotor motor2(2, MOTOR12_64KHZ);
AF_DCMotor motor3(3, MOTOR12_1KHZ);
AF_DCMotor motor4(4, MOTOR12_1KHZ);
pinmode(14,input); // set the pin to input
int BUTTON = digitalread(14); // read analog pin 0 as digital and set it to a variable
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");
void loop() {
if (BUTTON == HIGH) // it shows pressed