Pages: [1]   Go Down
Author Topic: Noob Programming Question  (Read 614 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, Im sure its been asked before but I cannot seem to find the answer im looking for in the search.   How do you/ Is it possible to  use multiple codes  in arduino.   I have seen some code where  there is a few snippets on different sketches that are used together in arduino.   I kinda just need a nudge in the right direction or a lil explanation of  how to include a seperate sketch in the main script.

Lol im sure yall are shaking your head but this is my super basic explanation of my needs or idea.

I want one script to be a controller type script for other scripts.   Similar to HTML & CSS where  they feed off eachother for a complete script.  Thank you very much. I dont really need a huge explanation Im just to cheap to buy a book at this point in time lol Thank you.
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3447
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you/ Is it possible to  use multiple codes  in arduino.
Yes, it is possible that multiple pieces of code in a single sketch.

Quote
Lol im sure yall are shaking your head but this is my super basic explanation of my needs or idea.
It's more of an extremely broad question that can really only be answered with "it depends on what you're trying to do"

Quote
I want one script to be a controller type script for other scripts.   Similar to HTML & CSS where  they feed off eachother for a complete script.  Thank you very much. I dont really need a huge explanation Im just to cheap to buy a book at this point in time lol Thank you.
What scripts?
Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 17
Posts: 781
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Grumpy Mike put together a decent guide to merging code:
http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

It's not nearly as simple/trivial as web based scripts, but it can be done.
Logged


Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I want one script to be a controller type script for other scripts.

What do you mean exactly ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In all honesty I dont know what im tryin to do yet. I am still very basic with very little programming experience but I have a good understanding. I can read code pretty well, just not write it.  Im kinda in the stage of brainstorming a project and I was just curious as to whats possible and how i should approach anything. I love the idea of having seperate sketches for 1 program as it gives it clarity in a way. I have book marked the article bout merging code and I greatly appreciate your help.   Im glad to be a member of this forum.
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I was moving my first steps with Arduino (and I've not finished yet ;-) ) I used this approach: write a test sketch that exploited a new feature / library / "thing" I wanted to study and learn how to use in my programs, and nothing else. I tried to keep these "single function" sketches as simple as possible. As soon as I felt comfortable in using this new (for me) Arduino feature or library, I stopped using that sketch, to avoid "polluting" it with the new ideas that came to mind.

I don't really copy code snippets from those sketches inside bigger, "real" programs, but I often copy their structure, or use them to easily remember how to use a library that I haven't touched in a while.

This is my single cent :-)
Logged

Pages: [1]   Go Up
Jump to: