From 9bfdb9962c3f2904ab9eb71474bc76b0f89bd808 Mon Sep 17 00:00:00 2001 From: knolax <1339802534.kk@gmail.com> Date: Thu, 21 Apr 2016 16:57:21 -0400 Subject: arduino files --- ROBOARM/ROBOARM.ino | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 ROBOARM/ROBOARM.ino (limited to 'ROBOARM') diff --git a/ROBOARM/ROBOARM.ino b/ROBOARM/ROBOARM.ino new file mode 100644 index 0000000..64d7699 --- /dev/null +++ b/ROBOARM/ROBOARM.ino @@ -0,0 +1,62 @@ +#include + +#define B_S 7 +#define J_S 8 +#define M_S 9 +#define T_S 10 +Servo bases; +Servo joints; +Servo mans; +Servo turns; +int basea = 90; +int jointa = 60; +int mana = 30; +int turna = 90; +char in = 0; +void setup() { + pinMode(B_S,OUTPUT); + pinMode(J_S,OUTPUT); + pinMode(T_S,OUTPUT); + pinMode(M_S,OUTPUT); + bases.attach(B_S); + joints.attach(J_S); + mans.attach(M_S); + turns.attach(T_S); + Serial.begin(9600); + +} + +void loop() { + if (Serial.available()) { + in = Serial.read(); + Serial.print(in,HEX); + switch (in) { + case 'A' : + basea = basea + 5; + Serial.print(basea,DEC); + break; + case 'S' : + basea = basea - 5; + Serial.print(basea,DEC); + break; + + + case 'X' : + jointa = jointa + 5; + break; + case 'C' : + jointa = jointa - 5; + break; + case 'W' : + mana = mana + 1; + break; + case 'E' : + mana = mana - 1; + break; + } + } + bases.write(basea); + joints.write(jointa); + mans.write(mana); + +} -- cgit v1.1