Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Stepper_28BYJ_48.h"
- Stepper_28BYJ_48 stepper(8,6,5,4);
- void setup() {
- // initialize the serial communication:
- Serial.begin(9600);
- }
- void loop() {
- int passi - 48;
- // check if data has been sent from the computer:
- if (Serial.available()) {
- // read the most recent byte:
- passi = Serial.read();
- Serial.println(passi);
- // set the step of the motor:
- stepper.step(passi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement