Simple Question about Programming the Arduino
August 4, 2009
Having built many robots and programmed in several languages, I am new to Arduino and C. I wish to make a subroutine and place it in a working program.
I have two programs that are running perfectly right now at this moment. I want to combine them together and have the second short program be able to be called many times as a subroutine and be placed in the larger program. I can't for the life of me make it happen. I usually get some error when I trie to compile it. I just want to know how to make a subroutine.
In Pbasic on the BasicStampII, I would simply have my program running and say GoSub either the line number or the name of the subroutine. When it was finished, I would put a RETURN and I could call it a hundred times if I wanted to. If you could explain this to an ignorant about C programmer, I can get on with my project.