Permalink
Browse files

send signals to all motors

  • Loading branch information...
1 parent e86ef57 commit 1caaa044500db62f5f750cd9c34c210e9cd34b63 @svdgraaf committed Apr 29, 2012
Showing with 12 additions and 4 deletions.
  1. +2 −2 pwm_test/input.py
  2. +10 −2 pwm_test/pwm_test.ino
View
@@ -1,5 +1,5 @@
import serial
-s = serial.Serial('/dev/tty.usbmodemfd131')
+s = serial.Serial('/dev/tty.usbmodemfa141')
import termios, fcntl, sys, os
fd = sys.stdin.fileno()
@@ -21,4 +21,4 @@
except IOError: pass
finally:
termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
- fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+ fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
View
@@ -1,8 +1,12 @@
int pwmPin = 9; // LED connected to digital pin 9
-int current_power = 100;
+int current_power = 120;
void setup() {
Serial.begin(9600);
+ analogWrite( 3, current_power);
+ analogWrite( 9, current_power);
+ analogWrite( 10, current_power);
+ analogWrite( 11, current_power);
}
void loop() {
@@ -29,11 +33,15 @@ void loop() {
if(power != current_power)
{
- analogWrite( pwmPin, power);
+ analogWrite( 3, power);
+ analogWrite( 9, power);
+ analogWrite( 10, power);
+ analogWrite( 11, power);
Serial.println(power);
current_power = power;
}
}
}
+

0 comments on commit 1caaa04

Please sign in to comment.