Advertisement
FedezPower

Untitled

Apr 4th, 2020
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Stepper_28BYJ_48.h"
  2.  
  3. Stepper_28BYJ_48 stepper(8,6,5,4);
  4.  
  5. void setup() {
  6.   // initialize the serial communication:
  7.   Serial.begin(9600);
  8. }
  9.  
  10. void loop() {
  11.   int passi - 48;
  12.  
  13.   // check if data has been sent from the computer:
  14.   if (Serial.available()) {
  15.     // read the most recent byte:
  16.     passi = Serial.read();
  17.     Serial.println(passi);
  18.     // set the step of the motor:
  19.     stepper.step(passi);
  20.   }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement