Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <AccelStepper.h>
- #define HALFSTEP 8
- // Definicje pinów silnika// Definicje pinów silnika
- #define motorPin1 8 // IN1 na sterowniku ULN2003 1
- #define motorPin2 9 // IN2 na sterowniku ULN2003 1
- #define motorPin3 10 // IN3 na sterowniku ULN2003 1
- #define motorPin4 11 // IN4 na sterowniku ULN2003 1
- // Inicjalizuj z sekwencją pinów IN1-IN3-IN2-IN4, aby używać AccelStepper z 28BYJ-48
- AccelStepper motor (HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);
- void setup () {void setup () {
- motor.setMaxSpeed (1000.0);
- motor.setAcceleration (100.0);
- motor.setSpeed (20);
- motor.moveTo (20000);
- } // - (konfiguracja końcowa) ---} // - (konfiguracja końcowa) ---
- void loop () {void loop () {
- // Zmień kierunek, gdy stepper osiągnie pozycję docelową// Zmień kierunek, gdy stepper osiągnie pozycję docelową
- if (stepper1.distanceToGo () == 0) {if ( stepper1 . distanceToGo () == 0 ) {
- stepper1.moveTo (-stepper1.currentPosition ());. moveTo (- stepper1 . currentPosition ());
- }}
- stepper1.run ();. run ();
- }}
- Arduino:1.8.9 (Windows 7), Płytka:"Arduino/Genuino Uno"
- Silnik_krokowy:15:3: error: stray '\342' in program
- Silnik_krokowy:15:3: error: stray '\200' in program
- Silnik_krokowy:15:3: error: stray '\213' in program
- Silnik_krokowy:15:3: error: stray '\342' in program
- Silnik_krokowy:15:3: error: stray '\200' in program
- Silnik_krokowy:15:3: error: stray '\213' in program
- Silnik_krokowy:17:3: error: stray '\342' in program
- Silnik_krokowy:17:3: error: stray '\200' in program
- Silnik_krokowy:17:3: error: stray '\213' in program
- Silnik_krokowy:17:3: error: stray '\342' in program
- Silnik_krokowy:17:3: error: stray '\200' in program
- Silnik_krokowy:17:3: error: stray '\213' in program
- C:\Users\Michał\Desktop\Projekty\Nauka\Lekcja 1\Silnik_krokowy\Silnik_krokowy.ino: In function 'void setup()':
- Silnik_krokowy:14:30: error: a function-definition is not allowed here before '{' token
- Silnik_krokowy:22:14: error: a function-definition is not allowed here before '{' token
- Silnik_krokowy:29:2: error: expected '}' at end of input
- exit status 1
- stray '\342' in program
- Ten raport powinien zawierać więcej informacji jeśli w
- File -> Preferencje zostanie włączona opcja "Pokaż
- szczegółowe informacje podczas kompilacji"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement