質問編集履歴
2
削除された内容の復元を行いました
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,23 @@
|
|
1
1
|
servo.write(A);の所で'A'was not declared in this scopeとエラーがでます。
|
2
|
-
どのように改善すればよいでしょうか。回答お願いします
|
2
|
+
どのように改善すればよいでしょうか。回答お願いします
|
3
|
+
#include<stdio.h>
|
4
|
+
#include<math.h>
|
5
|
+
#include<Servo.h>
|
6
|
+
Servo servo;
|
7
|
+
void setup(){
|
8
|
+
|
9
|
+
servo.attach(9);
|
10
|
+
double a,b,c,A,degree;
|
11
|
+
a=10;
|
12
|
+
b=20;
|
13
|
+
c=30;
|
14
|
+
A=acos((b*b+c*c-a*a)/2*b*c);
|
15
|
+
degree=A*180.0/PI;
|
16
|
+
}
|
17
|
+
void loop()
|
18
|
+
{
|
19
|
+
servo.write(A);
|
20
|
+
delay(1000);
|
21
|
+
servo.write(0);
|
22
|
+
delay(1000);
|
23
|
+
}
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,26 +1,2 @@
|
|
1
1
|
servo.write(A);の所で'A'was not declared in this scopeとエラーがでます。
|
2
|
-
どのように改善すればよいでしょうか。回答お願いします
|
2
|
+
どのように改善すればよいでしょうか。回答お願いします
|
3
|
-
|
4
|
-
#include<stdio.h>
|
5
|
-
#include<math.h>
|
6
|
-
#include<Servo.h>
|
7
|
-
Servo servo;
|
8
|
-
|
9
|
-
void setup(){
|
10
|
-
|
11
|
-
servo.attach(9);
|
12
|
-
double a,b,c,A,degree;
|
13
|
-
a=10;
|
14
|
-
b=20;
|
15
|
-
c=30;
|
16
|
-
|
17
|
-
A=acos((b*b+c*c-a*a)/2*b*c);
|
18
|
-
degree=A*180.0/PI;
|
19
|
-
}
|
20
|
-
void loop()
|
21
|
-
{
|
22
|
-
servo.write(A);
|
23
|
-
delay(1000);
|
24
|
-
servo.write(0);
|
25
|
-
delay(1000);
|
26
|
-
}
|