fork download
  1. #include <Servo.h>
  2.  
  3. Servo servo;//サーボのインスタンス
  4.  
  5. void setup() {
  6. Serial.begin(9600);
  7. servo.attach(3);
  8. }
  9.  
  10. void loop(){
  11. if(Serial.available() > 0){
  12. int rotate = (int)Serial.read();
  13. servo.write(rotate);
  14. }
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:19: error: Servo.h: No such file or directory
prog.cpp:3: error: ‘Servo’ does not name a type
prog.cpp: In function ‘void setup()’:
prog.cpp:6: error: ‘Serial’ was not declared in this scope
prog.cpp:7: error: ‘servo’ was not declared in this scope
prog.cpp: In function ‘void loop()’:
prog.cpp:11: error: ‘Serial’ was not declared in this scope
prog.cpp:13: error: ‘servo’ was not declared in this scope
stdout
Standard output is empty