(small update)
by using the stepper motor default script of the arduino interface
i got the motor spinning successfully.
current pinout:
digital pin 1-6 (LCD display)
digital Pin 8-11 motor
both codes are stock arduino codes i use for testing:
the hello world LCD display code
and the stepper motor code under: example/stepper/onestep revolution
the plan is to use the motor with 2 endstops and a timer sensor so the motor wil spin for X minutes at time X
the same is at time Y.
the endstops are used so that if the motor spins further than needed it will stop
the display only has to show the current time, and active program/code
like
time: 16:06
program active 1
the 2 extra buttons are overide buttons so i can toggle program/code X or Y when needed.
the leds are just for show
the current code: {combination of hello world and motor driver}
{im using a arduino uno for testing purposes {since its easier to program due not having a usb compiler for the arduino mini}}
// include the library code:
#include <LiquidCrystal.h>
#include <Stepper.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 5, en = 6, d4 = 1, d5 = 2, d6 = 3, d7 = 4;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// put your setup code here, to run once:
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// put your main code here, to run repeatedly:
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
ps:
what type of time sensor do you guys recommend?
DS3231??
DS1302??
41F6 DC5V AR I2C?
a different one?
i still have 4 digital pins left.
and i need to connect at least 4 buttons {2 of which are end-stops}
and if possible 3 leds {look at given image for more information}