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 Sending arduino a numerical command to trigger a function
  • 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 5 replies
  • Answers 1 answer
  • Subscribers 392 subscribers
  • Views 790 views
  • Users 0 members are here
  • command
  • sketch
  • code
  • serial
Related

Sending arduino a numerical command to trigger a function

funinalaska
funinalaska over 10 years ago

Ok, I have been researching this for a few days now.

I am trying to learn how to send a numerical value to an arduino and have it select the function that I assign that code.

I am trying to start small and work my way to a final project involving multiple arduinos.

In the short term I would like to from the serial monitor send a code say 5/1 to tell my arduino to set pin 5 HIGH

eventually I would like to have multiple arduinos in a mesh network using nrf24l01+ modules to be able to accomplish this through a 3 step value.

1/5/1 to tell the arduino assigned as (1) to set pin 5 to HIGH or 2/7/0 Arduino (2) to set pin 7 to LOW

Right now I am am simply trying to use the serial monitor to communicate with one arduino.

I feel this is a good first step to trying to tackle this project as I feel this can very quickly become a very complicated undertaking.

I am not great with code and after not doing anything for almost a year due to family and relocation issues I am very frustrated.

Anyone that might be able to help point me toward a tutorial that might be able to help me with the basics would be greatly appreciated.

If you are interested the eventual goal of this is home automation and other smart home functions.

This is a project that I have been thinking about and buying hardware for over the past 2 years and would like to get started on.

 

I did run across this post:

http://forums.trossenrobotics.com/tutorials/how-to-diy-128/complete-control-of-an-arduino-via-serial-3300/

but I am having no luck getting the code to process correctly.

Is there another method or better tutorial out there?

  • Sign in to reply
  • Cancel

Top Replies

  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago +1 verified
    should find all you need here http://www.element14.com/community/groups/arduino/blog/2014/06/09/fast-track-to-arduino-programming regards Peter
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    should find all you need here

    http://www.element14.com/community/groups/arduino/blog/2014/06/09/fast-track-to-arduino-programming

     

    regards

     

    Peter

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • funinalaska
    0 funinalaska over 10 years ago in reply to Robert Peter Oakes

    Peter,

    Thank you very much.

    That will be very helpful.

    I will need to go through that a few times to understand everything but I think that should be able to help me.

    Then I think to do my project I just need to adapt it from being a serialBuffer to a radioBuffer.

    I'll work on it through the serial first though.

     

    I do have one other thing I cannot figure out.

    I plan on using this to control 3 arduinos each of which will be running an 8 channel relay module.

    I will only be using 7 of those channels for lighting control and the 8th is for the master power supply trigger.

    I would like to write a function that will check each of those 7 outputs and if any of them are high then it also makes the 8th high

    and likewise if they are all low and only if they are all low then make the 8th go low.

     

    any advise on this?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to funinalaska

    One of the later videos has Ethernet buffer and serial working at the same time and still only a single interpreter of the commands

     

    my internet of holiday lights challenge project is implementing radio, network and serial all at the same time with command processing to determine which slave controller to send out the command to, the destination then interprets the command to determine what do do, for example, change the colour of an RGB LED strip, change the sequence pattern on a star shaped neo-pixel , update a display text on a MATRIX display.

     

    Every one of the slaves with their respective Lights options are connected via NRF24L01 radios, the master being a subscriber to several MQTT topics via WIFI and the internet, I am in the process of adding another module to the mix that uses a WIFI MCU ( TI Launchpad CC2200 ) and will get its own subscription data via MQTT and drive relay outputs

     

    Does this sound a bit like your project, perhaps on a grander scale, if so, all my code and designs are being shared via the challenge topic areas here http://www.element14.com/community/groups/arduino/blog/2014/12/09/byob-party-bring-you-own-bulbs--the-internet-of-holiday-lights

     

    Hope this helps

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • funinalaska
    0 funinalaska over 10 years ago

    Peter.

    Thank you for your help.

    after a bit of tinkering and experimentation I got exactly what I wanted using serial commands from the computer.

    I still need to do a fair bit of experimenting with the radios before I understand what is really going on with those, but this was a huge step forward.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to funinalaska

    Good job

     

     

     

    If you need more help, just ask

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