Browse Source

first commit

Johannes Reitmeier 1 year ago
commit
98aa82ea1f
1 changed files with 32 additions and 0 deletions
  1. 32 0
      Leobots_Schilderdreh/Leobots_Schilderdreh.ino

+ 32 - 0
Leobots_Schilderdreh/Leobots_Schilderdreh.ino

@@ -0,0 +1,32 @@
+//L298N Motorsteuerung
+//speed control
+int GSM1 = 10; // -> on ENA
+
+int in1 = 8;   // is on input 1
+int in2 = 9;   // is on input 2
+
+
+void setup() {
+  // put your setup code here, to run once:
+  Serial.begin(9600);
+  pinMode(GSM1, OUTPUT);
+
+  pinMode(in1, OUTPUT);
+  pinMode(in2, OUTPUT);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  Serial.println("Works");
+  
+  analogWrite(GSM1, 70);
+  digitalWrite(in1, HIGH);
+  digitalWrite(in2, LOW);
+
+  delay(2000);
+
+  digitalWrite(in1, LOW);
+  digitalWrite(in2, HIGH);
+
+  delay(2000);
+}