Page 1 of 1

Resource for getting started coding.

Posted: Thu Jan 08, 2015 12:17 pm
by paperdesk
I had fun with the wizard, but it's a bit slow and limiting for everything I want to do. I don't have a background in coding, so I'm looking at this as a great learning experience.

I've read the "How the code structure works" post several times, and really got a lot out of it, but I still have a long way to even cover the basics.

Is there a resource that will help me learn the basics? For example, I know how to make simple edits to existing code but I don't know how to replace large sections of code, and for that matter don't even know where to put new code. For example, there are places that say something like "insert code below". Do I place my code there, or do I delete the old code and insert the new? I suppose that the answer is "it depends" and that's ok, but I then need to know what it depends on!

I realize there is a lot to learn, and I don't expect to be a coding guru overnight, but learning how to use other people's code would be a great place to start. I've browsed around for such a resource, but seemed to have missed it somehow. If someone can point me to a place where I can learn the basics I'd really appreciate it.

Thanks!

Ted

Re: Resource for getting started coding.

Posted: Thu Jan 08, 2015 1:00 pm
by binder
those sections "insert below here" etc, are spots to have you add new code.
if you are wanting to change code, for say port4, you would just add your new code and then delete the other references to port4 in other spots.

when the controller starts up, it executes the setup() function. think of this as like initializing the controller and code. then the controller jumps down to the loop() function and repeats it indefinitely (unless the watchdog timer kicks in and resets the controller).
inside the loop is where all the typical functions that update the controller take place. everything is executed in order from top to bottom. so if you update a port at the topp and then it is updated again towards the bottom of the function, the result of the. ist recent update will be what happens.
at the bottom of the loop() function, there is a function and a comment that says "must be last line". that line commits all the changes to the ports and updates the controller.

this is just a simple start for you. it is a little tough to get into more details while on my ipad but should help you out some.


Sent from my iPad mini

Re: Resource for getting started coding.

Posted: Thu Jan 08, 2015 1:04 pm
by paperdesk
Great, thanks so much! I'll play with it later today!

Re: Resource for getting started coding.

Posted: Thu Jan 08, 2015 3:57 pm
by binder
paperdesk wrote:Great, thanks so much! I'll play with it later today!
I'll see if I can put some more together for you and add onto the other getting started post with how to program the controller.

I will also say this, understanding and being able to read c/c++ will help because that is the language used to program the controller.

Sent from my Moto X

Re: Resource for getting started coding.

Posted: Thu Jan 08, 2015 4:18 pm
by cosmith71
Here's a good place for Arduino basics:

http://arduino.cc/en/Reference/HomePage

Re: Resource for getting started coding.

Posted: Thu Jan 08, 2015 6:12 pm
by paperdesk
Good stuff! Thanks to both of you! Hopefully I can at least learn enough of the basics to be able to insert other people's code, even if I don't ever learn to create my own.