shaneshane1 said:
iv looked at the data sheet for BASIC commands and thats seems faily straight forward
I just installed the editor and am looking through the command set. Nice! Very complete. Looks like they've thought of almost everything.
Well done! Looks like a really easy chip to use.
But i dont really know how to string these commands together
Well, stringing those commands together is what programming is. You'll pick it up. When you want to get something done, try to write down on paper in english (or pseudo-code), what you want to accomplish, step by step in the order you think it needs to be done. This is called an
algorithm. This will get easier with practice. Be sure to double or triple space so you can stuff in more commands you think of later to fix the stuff you never thought of on the first pass.
You
WILL crumple and throw away many poorly thought out algo's and will rewrite large sections as you write code and test it.
Then find commands that will accomplish the steps and start typing them in, checking off things on your scratch paper as you get each part coded. You'll be useless at it at first, and you'll spend a lot of time thrashing back and forth through the manual trying to find the right commands to use. Don't get discouraged. It gets much easier with practice. After a while you'll memorize the more common commands and you'll just know how to do things.
Don't aim too high at first. Start very small. Write lots of tiny programs. Modify them to see what happens. Get small sections of your code to work individually. After each part works, put em together.
You can't learn programming by reading alone. You MUST write code, and lots of it, even if it's crappy code. You'll get better with practice.
eg: if i want to use an input(button) to activate a output. I dont know where to start with things like that?
First thing is to make a "main" loop like the first LED blink demo. Inside that loop you'll "poll" (check it every time thru the loop) the input pin your switch is on with an "if/then" statement.
Read Manual 3 to learn how to interface a switch properly. It'll need a pull-up or pull-down resistor to hold the pin electrically in the "off" position until you actually switch the switch.
When the program sees the pin has changed and is low or high (however you've built your circuit) the "if" statement will branch to a part of the code that turns on your LED. As long as the switch is off this part of code gets skipped past.
Am I making any sense?