summaryrefslogtreecommitdiff
path: root/ROBOARM
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2016-04-21 16:57:21 -0400
committerknolax <1339802534.kk@gmail.com>2016-04-21 16:57:21 -0400
commit9bfdb9962c3f2904ab9eb71474bc76b0f89bd808 (patch)
tree1de08072fe9c8822bd28ae49c26d8e343627a9fb /ROBOARM
parentfc401e372045a728e182cd775e854a404de4bbe4 (diff)
arduino filesHEADmaster
Diffstat (limited to 'ROBOARM')
-rw-r--r--ROBOARM/ROBOARM.ino62
1 files changed, 62 insertions, 0 deletions
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 <Servo.h>
+
+#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);
+
+}