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
Arduino
  • Products
  • More
Arduino
Arduino Forum Need a challange? - Can someone help with some code?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 30 replies
  • Answers 6 answers
  • Subscribers 394 subscribers
  • Views 2128 views
  • Users 0 members are here
Related

Need a challange? - Can someone help with some code?

nealbopper
nealbopper over 8 years ago

Hello Everyone, image

Well, I am just about ready to start constructing my Chicken coop automatic doors. (I am building 2 automatic doors) I got away from the DeWalt drill motors

and just bought 2 12v 30a step motors. I needed to combine some code into another code I am using from Seth's code from his coop door project. Seth has

a site called, "Land to House" I am wanting to add the Helloworld code to his code because Helloworld is how I got my LCD and RTC (real time clock) to work

together. Do I post the code here or do I zip it and send it to you so I'm not going overboard here. Is someone willing to take a look at it? How do you wish I present

the code to you? Thanks in advance. Everyone has been so helpful so far. It will not let me attach a file.

  • Sign in to reply
  • Cancel

Top Replies

  • COMPACT
    COMPACT over 8 years ago +2
    I don't think I can coop with it!
  • nealbopper
    nealbopper over 8 years ago in reply to jlangbridge +1
    Good morning, I didn't work on the doors yesterday. I got some new LED shop lights I wanted to wire into the garage. That's done. I have a question for you. As you can see, this code is for 1 motor. I…
  • jlangbridge
    jlangbridge over 8 years ago in reply to nealbopper +1 suggested
    My sincerest condolences for your loss. Take the time you need, of course. I'll be here, adjusting code and fiddling with devices. From what I can tell, you have here the basics; motors will activate according…
Parents
  • jlangbridge
    0 jlangbridge over 8 years ago

    Ummm... neither, I think. It would probably be best to pastebin the source code, or something like that. That way, the forum remains readable, I can have a look, and everyone else gets to help too (which doesn't happen if everything is done by email). Upload the source(s) somewhere, send us the link, and let's have a look image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • nealbopper
    0 nealbopper over 8 years ago in reply to jlangbridge

    Hum, never did that before but it was quite easy and a great idea. Thanks for the new discovery.

    OK, do not beat me with a stick, I do not use code at all so remember I am just learning. However I

    did add code to the, "Helloworld" code for the real time clock to get my 2x16 LCD to work. I do not

    know how I did it but the code worked the first time. Miracles do happen.

    Have a look and let me know what you see. My error is, "in was not declared in this scope."

     

    Arduino Coop Door Project code - Pastebin.com

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to nealbopper

    Hey, we all started off somewhere image No stick beating here, don't worry! On the contrary, if you managed to modify it to get a message on the LCD screen, it's great work! I'm on a new lappy, so give me a minute to download and install all things Arduino, and I'll be right back!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to nealbopper

    Aha! I see an error or two. For example, line 170. In C, you can't have "nameless" code. Line 170 starts off with {, and a few lies later finishes with }. Inside, there is some code, which looks suspiciously like initialization code. For this to work, this needs to be inside a function, that is to say a portion of code that can be called (for example, lines 102 and 135). This might be a bit of work, but we'll get this done image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • nealbopper
    0 nealbopper over 8 years ago in reply to jlangbridge

    OK, Line 170 is where I added the, "Helloworld"  code to the Land to house code. It probably is source code but I do not know where the source code ends and programming starts. The original code ended on line 168 so I figured I just needed to add the "Helloworld" code I had right under it. Should I move 170 up in the code before line 79, (void loop())?

    Question, is there a way to add the line number on my original Arduino code?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to nealbopper

    Okay! Everything is installed, but sleep is kicking in (close to midnight here).

     

    I don't think there is a way of showing line numbers in the Arduino IDE...

     

    I've had a quick look, and reorganized a little bit the setup() function, adding your LCD hello world code. I still have a bit of work to do, though... The code is here: [C] //Locking, Automatic Chicken Coop Door //By Seth Johnson Land To House llc - Pastebin.com

     

    If anyone wants to take over.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • nealbopper
    0 nealbopper over 8 years ago in reply to jlangbridge

    Thank you so much for your help. Have a great night.  I'm going to learn this "code" jargon soon. But first I need to take care of my ladies. (chicken hens) LOL

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • nealbopper
    0 nealbopper over 8 years ago in reply to jlangbridge

    Thank you so much for your help. Have a great night.  I'm going to learn this "code" jargon soon. But first I need to take care of my ladies. (chicken hens) LOL

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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