element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Robotics
  • Technologies
  • More
Robotics
Blog Marty the pacing robot
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Robotics to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rancell
  • Date Created: 31 Jan 2019 10:13 AM Date Created
  • Views 1091 views
  • Likes 9 likes
  • Comments 2 comments
  • stem projects
Related
Recommended

Marty the pacing robot

rancell
rancell
31 Jan 2019

I had worked out how to control my Marty with Scratch. But you quickly run out of dance routines to make it do. For more interesting programs, you need some input.

 

When you assemble your Marty it doesn't have any sensors connected to it. But the box does have two limit switches in it, and no instructions on what to do with them. I was trying to work out what to do to them (Attach them to the hands? Use them to detect when the case is open?) until I decided they would be useful to detect if Marty had walked into a wall. And then I noticed the feet had some perfectly sized holes (see below). So I guess that's what they're intended for! Using the supplied nuts and bolts they fit perfectly. I attached one to the front of the right foot and the other to the back of the left foot.

image

To use them I fed the connectors through a hole in the bottom of the case and attached to the GPIO connectors on "Rick" (the name of Marty's circuit board brain). Note the colours of the wires are white=IO, red=+5V, black=GND. The front switch is on GPIO 0 and the rear switch on GPIO 1.

image

Using the "GPIO input" blocks I wrote a simple program to make Marty walk in a direction until it hits a wall, then walk the other direction:

image

But it didn't work... Marty would hit the wall, and I'd see the switch trigger but it would keep walking. Then I realised it wasn't going to be quite so simple. The walk blocks take time to run so the GPIO inputs are only checked for a short time. If a switch is not being held down between the walk blocks it wont be detected. What was needed was some code to poll the switches and set some variables once they were triggered. Here is my updated program:

image

Works now! Here is my Marty stuck in a pacing loop (sorry Marty!):

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

  • Sign in to reply

Top Comments

  • 14rhb
    14rhb over 6 years ago +2
    Hi Robert, This was what I've been waiting to see, great work, thank you. Poor Marty, I hope he has found a way out of the fiendish trap Rod
  • genebren
    genebren over 6 years ago +2
    Great little modification to Marty. That is a pretty cool little robot. I really like his gait. Gene
  • genebren
    genebren over 6 years ago

    Great little modification to Marty.  That is a pretty cool little robot.  I really like his gait.

     

    Gene

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • 14rhb
    14rhb over 6 years ago

    Hi Robert,

     

    This was what I've been waiting to see, great work, thank you.

     

    Poor Marty, I hope he has found a way out of the fiendish trapimage

     

    Rod

    • Cancel
    • Vote Up +2 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