Forum >Replies by L_JESSIE
userhead L_JESSIE
Replies (8)
  • You Reply: Hi ,
    it is very simple,
    you can connect 4 servo to the model
    and try this code .
    You can change the date which you need.



    [code]

    #include <Servo.h>

    Servo Aservo;  // create servo object to control a servo
                    // a maximum of eight servo objects can be created
    Servo Bservo;
    Servo Cservo;
    Servo Dservo;

    int posA = 0;    // variable to store the servo position
    int posB = 0;
    int posC = 0;
    int posD = 0;

    void setup()
    {
      Aservo.attach(2);  // attaches the servo on pin 2 to the servo object
      Bservo.attach(3);  // attaches the servo on pin 3 to the servo object
      Cservo.attach(9);  // attaches the servo on pin 9 to the servo object
      Dservo.attach(11); // attaches the servo on pin 11 to the servo object
    }


    void loop()
    {
      for(posA = 0,posB = 0,posC = 0,posD = 0; posA < 180,posB < 180,posC < 180,posD < 180; posA += 1,posB += 1,posC += 1,posD += 1)  // goes from 0 degrees to 180 degrees
      {                                  // in steps of 1 degree
        Aservo.write(posA);              // tell servo to go to position in variable 'posA'
        Bservo.write(posB);              // tell servo to go to position in variable 'posB'
        Cservo.write(posC);              // tell servo to go to position in variable 'posC'
        Dservo.write(posD);              // tell servo to go to position in variable 'posD'
        delay(15);                      // waits 15ms for the servo to reach the position
      }
     
      for(posA = 180,posB = 180,posC = 180,posD = 180; posA>=1,posB>=1,posC>=1,posD>=1; posA-=1,posB-=1,posC-=1,posD-=1)            // goes from 180 degrees to 0 degrees
      {                               
        Aservo.write(posA);              // tell servo to go to position in variable 'posA'
        Bservo.write(posB);              // tell servo to go to position in variable 'posB'
        Cservo.write(posC);              // tell servo to go to position in variable 'posC'
        Dservo.write(posD);              // tell servo to go to position in variable 'posD'
        delay(15);                      // waits 15ms for the servo to reach the position
      } 
    }
    [/code]
  • You Reply: and what is pavgud?
  • You Reply: and what is pavgud?
  • You Reply: Hi.

    I'm not familiar with Netduino.but i want to try it.
    And you can give me more information about your board.

    I probably need some days to try.Would you mind?
  • You Reply: Hi.

    I'm not familiar with Netduino.but i want to try it.
    And you can give me more information about your board.

    I probably need some days to try.Would you mind?
  • You Reply: [quote="bi0s"]
    I have the same Problem :( Can you please make a Screen and publish a litte example code ?
    [/quote]
    Hi,you can try this code.
    [url=https://www.dfrobot.com/wiki/index.php/I2C/TWI_LCD1602_Module_(Gadgeteer_Compatible)_(SKU:_DFR0063)]https://www.dfrobot.com/wiki/index.php/I2C/TWI_LCD1602_Module_(Gadgeteer_Compatible)_(SKU:_DFR0063)[/url]

    And not forget download The Arduino I2C LCD library.You can download it on this page.
    [url=http://wiki.dfrobot.com.cn/index.php/(SKU:DFR0063)IIC_LCD1602_display_module_%E5%85%BC%E5%AE%B9Gadgeteer]http://wiki.dfrobot.com.cn/index.php/(SKU:DFR0063)IIC_LCD1602_display_module_%E5%85%BC%E5%AE%B9Gadgeteer[/url]

    Hope you can succeed.
  • You Reply: [quote="bi0s"]
    I have the same Problem :( Can you please make a Screen and publish a litte example code ?
    [/quote]
    Hi,you can try this code.
    [url=https://www.dfrobot.com/wiki/index.php/I2C/TWI_LCD1602_Module_(Gadgeteer_Compatible)_(SKU:_DFR0063)]https://www.dfrobot.com/wiki/index.php/I2C/TWI_LCD1602_Module_(Gadgeteer_Compatible)_(SKU:_DFR0063)[/url]

    And not forget download The Arduino I2C LCD library.You can download it on this page.
    [url=http://wiki.dfrobot.com.cn/index.php/(SKU:DFR0063)IIC_LCD1602_display_module_%E5%85%BC%E5%AE%B9Gadgeteer]http://wiki.dfrobot.com.cn/index.php/(SKU:DFR0063)IIC_LCD1602_display_module_%E5%85%BC%E5%AE%B9Gadgeteer[/url]

    Hope you can succeed.
  • You Reply: Thank you for your suggestions.It's helpful.