0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GR-CitrusでServoを動かすよ

Posted at

GR-CitrusでServoを動かすよ。

Servoモーターは百円で手に入るSG90を使います

GR-Citrus-WIre-Servo.jpg

元にしたのはこれです。
http://gadget.renesas.com/ja/reference/citrus/library_servo.html

# include <Arduino.h>
# include <Servo.h> 
 
# define INTERVAL 500
unsigned char g_pos = 0;
Servo servo0;
Servo servo1;

void setup() 
{ 
    servo0.attach(7);
    servo1.attach(6);
} 
  
void loop() {
    servo0.write(g_pos);
    servo1.write(g_pos);
    g_pos+=10;
    if(g_pos > 180){
            g_pos = 0;
    }
    delay(INTERVAL);
} 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?