Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
projets:horloge_qi:start [2023/02/27 15:09] admin [Notes techniques et matériaux] |
projets:horloge_qi:start [2023/03/01 09:48] (Version actuelle) admin [Notes techniques et matériaux] |
||
|---|---|---|---|
| Ligne 10: | Ligne 10: | ||
| {{projets: | {{projets: | ||
| ==== Références et liens ==== | ==== Références et liens ==== | ||
| - | * Notez ici les références artistiques et techniques, ou autres influences | + | * https:// |
| * | * | ||
| * | * | ||
| Ligne 28: | Ligne 28: | ||
| const int stepZPin = 4; //Z.STEP | const int stepZPin = 4; //Z.STEP | ||
| const int dirZPin = 7; // Z.DIR | const int dirZPin = 7; // Z.DIR | ||
| - | const int stepsPerRev=200; | ||
| - | int pulseWidthMicros | + | const int nombredepasH=120; // rapport 60 heure |
| - | int millisBtwnSteps | + | const int nombredepasM=2; |
| + | |||
| + | int speedoH = 100; //micro s entre les pas... | ||
| + | int speedoM = 100; | ||
| void setup() { | void setup() { | ||
| - | Serial.begin(9600); | ||
| pinMode(enPin, | pinMode(enPin, | ||
| digitalWrite(enPin, | digitalWrite(enPin, | ||
| - | Serial.println(F("CNC Shield Initialized" | + | |
| + | digitalWrite(dirYPin, HIGH); // Enables the motor to move in a particular direction | ||
| + | digitalWrite(dirXPin, | ||
| } | } | ||
| void loop() { | void loop() { | ||
| - | | + | for (int i = 0; i < nombredepasM; i++) { |
| - | digitalWrite(dirYPin, | + | |
| - | // Makes 200 pulses for making one full cycle rotation | + | |
| - | | + | |
| digitalWrite(stepYPin, | digitalWrite(stepYPin, | ||
| - | delayMicroseconds(pulseWidthMicros); | + | delayMicroseconds(speedoM); |
| digitalWrite(stepYPin, | digitalWrite(stepYPin, | ||
| - | delayMicroseconds(millisBtwnSteps); | + | delayMicroseconds(speedoM*10); |
| + | } | ||
| + | for (int i = 0; i < nombredepasH; | ||
| + | digitalWrite(stepXPin, | ||
| + | delayMicroseconds(speedoH); | ||
| + | digitalWrite(stepXPin, | ||
| + | delayMicroseconds(speedoH*10); | ||
| } | } | ||
| } | } | ||
| + | |||
| </ | </ | ||