element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Enchanted Objects
  • Challenges & Projects
  • Design Challenges
  • Enchanted Objects
  • More
  • Cancel
Enchanted Objects
Blog Enchanted Objects Design Challenge - Back on the straight and narrow
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 6 Apr 2015 7:29 AM Date Created
  • Views 605 views
  • Likes 4 likes
  • Comments 2 comments
  • enchanted_cottage
  • enchanted_objects
  • pwm
  • servo
  • arduino
Related
Recommended

Enchanted Objects Design Challenge - Back on the straight and narrow

Workshopshed
Workshopshed
6 Apr 2015

The basement and extension

Hans and the woodcutter assembled the planks to form support frame for Matilda's mechanics. The woodcutter liked the minimalism of the wooden design, "everything should be made as simple as possible, but not simpler" he said before returning to the forest.

image

Hans and Matilda cleaned up the parts from the Blacksmith and polished the axles before putting them together with the screws. They checked that everything ran smoothly, some minor changes would be needed but the mechanism provided the motion that was desired.

image

Crows

After their hard work they decided to rest on a log and have some sandwiches. Whilst they were eating they spotted two crows collecting sticks for nest building. The large crow picked up big sticks and flew very fast, but the large sticks clashed on the branches so the crow had to take a long route around to get to the nest. The small crow took smaller twigs and hopped slowly between the branches reaching its nest more quickly.

 

After their lunch Hans and Matilda decided to test the servos. They had a large servo with a long horn and a very small servo with a small horn. Hans wanted to know the current consumption and Matilda wanted to know if they had enough torque to move the mechanism. Before starting their test they downloaded the latest Arduino IDE.

image

To make the testing easier Matilda mounted the servos on a simple wooden test platform. Following the woodcutter's hint she connected these up to the test mechanism using bendy connecting rods.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

#include <VarSpeedServo.h>

/*
Sweep
by BARRAGAN <http://barraganstudio.com>
Adapted by Philip van Allen <philvanallen.com> for the VarSpeedServo.h library (October 2013) https://github.com/netlabtoolkit/VarSpeedServo
This example code is in the public domain
Moves servo, 180-0 degrees
Uses the wait feature of the 2013 version of VarSpeedServo to stop the code until the servo finishes moving
Note that servos usually require more power than is available from the USB port - use an external power supply!
*/
VarSpeedServo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
const int servoPin = 9; // the digital pin used for the servo

void setup() {
  myservo.attach(servoPin); // attaches the servo on pin 9 to the servo object
  myservo.write(0,255,true); // set the intial position of the servo, as fast as possible, wait until done
}

void loop() {
  myservo.write(180,255,true); // move the servo to 180, max speed, wait until done
  // write(degrees 0-180, speed 1-255, wait to complete true-false)
  myservo.write(0,30,true); // move the servo to 180, slow speed, wait until done
}

The Wolf

 

From nearby in the forest, the wolf was watching and listening.

 

Next: Enchanted Objects Design Challenge - Yum Yum Yun at the Enchanted Cottage

  • Sign in to reply
Parents
  • mcb1
    mcb1 over 10 years ago

    It's coming together.

     

    I see with the new servo library that you cannot interrupt it.

    So limit switches would need to cut the power to protect the servo ...

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • mcb1
    mcb1 over 10 years ago

    It's coming together.

     

    I see with the new servo library that you cannot interrupt it.

    So limit switches would need to cut the power to protect the servo ...

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Workshopshed
    Workshopshed over 10 years ago in reply to mcb1

    I plan to have the range of motion well within the limits of the servo, probably only using 90° movement. However, I will also likely have a power kill option for the servo so I can maximise battery life.

    I'm not adverse to customising a library if needed, it would not be difficult to add a Stop method, and I need to review what happens on powerup.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube