In steps 8...12, I didn't say anything about pasting code in. The code should already have been there. Try following instructions 8...12 again (and don't worry about 1...7). After unzipping and then opening the .side file, you should be able to to just click Run with Terminal, because the code should already be open in your IDE.
Andy,
I followed step 11 as far as I could: used SimpleIDE Open Project button, in dialogue found "Putting Code into a Cog" folder under downloads, opened folder to find SimpleIDE file "Putting Code into a Cog"...but there was no "Control System Test and Display.side in that folder. I ran the SimpleIDE file and again could not compile. cog_run error.
Would it be best if I gave you a call on the phone?
Sorry, my mistake. Here are the corrected instructions:
(11) Use SimpleIDE's Open Project button. Use the Open Project dialogue to find the "Putting Code into a Cog" folder on your desktop, and open "Putting Code into a Cog.side" from within that folder.
(12) After you have opened "Putting Code into a Cog.side" into SimpleIDE, click the Run with Terminal button.
In frustration...I shut down the machine and went off to work on another project.
When I returned...I brought up the file you sent and to my great surprise it is running showing on screen cycles(0), cycles(1), cycles(2), and errorVal. The lights are also blinking as expected.
The BS2 has a very limited but useful set of utility functions. Having a limited set makes things much easier.
I too have been struggling (and missing pull down reference menus from Stamps and SX) with the libraries. I have read through them many many times but find them lacking in examples...or a few more words of explanation.
I have "favorited" many 3rd party C tutorial sites to try and collect enough reverse engineering information to make sense of some of the commands. In addition....I have run countless small test programs examining the parameters and effects with diagnostics....to determine how some of the functions work.
I truly wish for a prop C reference manual. Would have saved me a lot of time.
Please understand...I love working in C on the prop. It is making me a convert. But...as a safeguard, I still have done a lifetime buy on SX processors as it is just too easy for me to get my idea fabricated due to excellent reference manual.
I am a true supporter of all Parallax processors and look forward to many more years with the prop.
...
In addition....I have run countless small test programs examining the parameters and effects with diagnostics....to determine how some of the functions work.
I truly wish for a prop C reference manual. Would have saved me a lot of time.
Brian,
Having to write small test programs is how things usually go for lack of documentation (or correct documentation). Props for figuring that out and plowing through that. It's not always wasted time, and you learn things along the way. Do you have any notes or suggestions that could be incorporated back in?
Also, what kind of documentation are you asking for? Like what buttons to push in the editor? Library information (what a function is, does, and returns)? C Language manual?
As for library information, it's pretty buried, and I'm probably linking it wrong, but for example the simple tools library is documented here: Documentation simpletools Library
One needs to scroll down to "detailed information" or click on one of the functions. But even verbose detail isn't enough as sometimes it just needs to be called in a test program like you did.
What's hard about C is it makes people feel like "you're just supposed to know" when it comes to the language and the gibberish the compiler spits out for errors. It's unfortunate that it has such a steep learning curve, but when you finally understand "C", you can apply it to so many different systems. Compiler writers don't seem to understand what people new to the language and environment and way of thinking would struggle with, so you're just not going to see much, if any, sympathy unfortunately.
Having to write small test programs is how things usually go for lack of documentation (or correct documentation). Props for figuring that out and plowing through that. It's not always wasted time, and you learn things along the way. Do you have any notes or suggestions that could be incorporated back in?
Also, what kind of documentation are you asking for? Like what buttons to push in the editor? Library information (what a function is, does, and returns)? C Language manual?
As for library information, it's pretty buried, and I'm probably linking it wrong, but for example the simple tools library is documented here: Documentation simpletools Library
One needs to scroll down to "detailed information" or click on one of the functions. But even verbose detail isn't enough as sometimes it just needs to be called in a test program like you did.
What's hard about C is it makes people feel like "you're just supposed to know" when it comes to the language and the gibberish the compiler spits out for errors. It's unfortunate that it has such a steep learning curve, but when you finally understand "C", you can apply it to so many different systems. Compiler writers don't seem to understand what people new to the language and environment and way of thinking would struggle with, so you're just not going to see much, if any, sympathy unfortunately.
Whicker,
I think you hit the nail on the head about really needing to already understand C before digging into some of the more involved functions and how they interact. I came into this with fairly high expectations that the Prop GCC system would be completely self explanatory....that is be able to learn C just from the tutorials and a Prop reference manual, similar to Parallax's prior Stamp and SX processors. One really needs to have a basic understanding of C.
I now understand, and do not fault Parallax, for bringing GCC to the table where the user needs to do some preliminary homework. I am doing that homework through 3rd party C sites and boning up on C syntax, protocols, and structures as fast as I can. It also took me a while, but now understand, that some special libraries have been written with prop infrastructure in mind. This is all good (thanks Jazzed).
However, I do sometimes get confused on all the surrogate functions in simpletools as opposed to the standard C functions (eg, scanf vs scan and others). I find the operation results are different when working in conjunction with string arrays, wav_player, and file names for FILE *fp type commands (I will be posting specifics in another post). Those small programs resulted in a convoluted solution to one of my projects....but it works...kinda...LOL.
In my opinion, the simple libraries need to have more detail included in the descriptions...for example, how many cogs are affected, do cogs turn off when function done, limits to parameter values, areas to watch out for, interaction with other functions, suggested examples...to name a few. As mentioned before, I have read through the libraries many times....including the more detailed descriptions.
So I will continue to study and learn C via the 3rd party sites and become even more familiar with programming in C. That is my responsibility and take it very seriously. I hope the wonderful engineers at GCC and Parallax will continue to elaborate on the simple tool libraries to make the move to propeller even easier.
Again... the ability to run C on the propeller is fantastic. I have learned so much already with the "instant" turn around on little programs. I continue to push myself to learn more. I truly appreciate those helping with GCC ... the original authors and all the forum specialists. Thank you.
you bring up a good point where you say " I came into this with fairly high expectations that the Prop GCC system would be completely self explanatory....that is be able to learn C just from the tutorials and a Prop reference manual, similar to Parallax's prior Stamp and SX processors."
I too appreciated the spiral bound book that came along with the Basic Stamp 1 in what must have been the late 90's.
I'm hoping some of the Parallax people read this, because I wonder if they do indeed desire the Propeller to be the platform to learn C for the first time on, bit by bit, with a series of simple projects to introduce the C language keywords and constructs in an organized manner. Or if it's more about helping teachers produce lesson plans. Or maybe both?
Comments
How do I put post_16.c into my SimpleIDE C library?
Discovery
Open it with SimpleIDE and press F4. Then build.
After a lengthy exercise, I was able to take the "Putting Code into a Cog.zip" file, unzipping it, then pasting the code into SimpleIDE C.
The compiler halted earlier in the code this time on a blank line.
Build Status
Done. Build Failed!
Check source for bad function call or global variable name '_cog_run'
C:\Doc...\Owner\Locals...\Temp\ccqihZsG.o:In function '_main':
(.text+0x157):
Frustrating!
Discovery
I followed step 11 as far as I could: used SimpleIDE Open Project button, in dialogue found "Putting Code into a Cog" folder under downloads, opened folder to find SimpleIDE file "Putting Code into a Cog"...but there was no "Control System Test and Display.side in that folder. I ran the SimpleIDE file and again could not compile. cog_run error.
Would it be best if I gave you a call on the phone?
Discovery
It is most likely the case (since you don't have cog_run()) that you don't have the latest Learn folder.
(11) Use SimpleIDE's Open Project button. Use the Open Project dialogue to find the "Putting Code into a Cog" folder on your desktop, and open "Putting Code into a Cog.side" from within that folder.
(12) After you have opened "Putting Code into a Cog.side" into SimpleIDE, click the Run with Terminal button.
In frustration...I shut down the machine and went off to work on another project.
When I returned...I brought up the file you sent and to my great surprise it is running showing on screen cycles(0), cycles(1), cycles(2), and errorVal. The lights are also blinking as expected.
Thank you and rest of the group that helped.
Discovery
In addition to frustration reduction, taking a break can also be good for coming back to the project with fresh eyes. I'm glad to hear it worked.
Andy
I too have been struggling (and missing pull down reference menus from Stamps and SX) with the libraries. I have read through them many many times but find them lacking in examples...or a few more words of explanation.
I have "favorited" many 3rd party C tutorial sites to try and collect enough reverse engineering information to make sense of some of the commands. In addition....I have run countless small test programs examining the parameters and effects with diagnostics....to determine how some of the functions work.
I truly wish for a prop C reference manual. Would have saved me a lot of time.
Please understand...I love working in C on the prop. It is making me a convert. But...as a safeguard, I still have done a lifetime buy on SX processors as it is just too easy for me to get my idea fabricated due to excellent reference manual.
I am a true supporter of all Parallax processors and look forward to many more years with the prop.
Regards,
Brian
Brian,
Having to write small test programs is how things usually go for lack of documentation (or correct documentation). Props for figuring that out and plowing through that. It's not always wasted time, and you learn things along the way. Do you have any notes or suggestions that could be incorporated back in?
Also, what kind of documentation are you asking for? Like what buttons to push in the editor? Library information (what a function is, does, and returns)? C Language manual?
As for library information, it's pretty buried, and I'm probably linking it wrong, but for example the simple tools library is documented here:
Documentation simpletools Library
One needs to scroll down to "detailed information" or click on one of the functions. But even verbose detail isn't enough as sometimes it just needs to be called in a test program like you did.
What's hard about C is it makes people feel like "you're just supposed to know" when it comes to the language and the gibberish the compiler spits out for errors. It's unfortunate that it has such a steep learning curve, but when you finally understand "C", you can apply it to so many different systems. Compiler writers don't seem to understand what people new to the language and environment and way of thinking would struggle with, so you're just not going to see much, if any, sympathy unfortunately.
Whicker,
I think you hit the nail on the head about really needing to already understand C before digging into some of the more involved functions and how they interact. I came into this with fairly high expectations that the Prop GCC system would be completely self explanatory....that is be able to learn C just from the tutorials and a Prop reference manual, similar to Parallax's prior Stamp and SX processors. One really needs to have a basic understanding of C.
I now understand, and do not fault Parallax, for bringing GCC to the table where the user needs to do some preliminary homework. I am doing that homework through 3rd party C sites and boning up on C syntax, protocols, and structures as fast as I can. It also took me a while, but now understand, that some special libraries have been written with prop infrastructure in mind. This is all good (thanks Jazzed).
However, I do sometimes get confused on all the surrogate functions in simpletools as opposed to the standard C functions (eg, scanf vs scan and others). I find the operation results are different when working in conjunction with string arrays, wav_player, and file names for FILE *fp type commands (I will be posting specifics in another post). Those small programs resulted in a convoluted solution to one of my projects....but it works...kinda...LOL.
In my opinion, the simple libraries need to have more detail included in the descriptions...for example, how many cogs are affected, do cogs turn off when function done, limits to parameter values, areas to watch out for, interaction with other functions, suggested examples...to name a few. As mentioned before, I have read through the libraries many times....including the more detailed descriptions.
So I will continue to study and learn C via the 3rd party sites and become even more familiar with programming in C. That is my responsibility and take it very seriously. I hope the wonderful engineers at GCC and Parallax will continue to elaborate on the simple tool libraries to make the move to propeller even easier.
Again... the ability to run C on the propeller is fantastic. I have learned so much already with the "instant" turn around on little programs. I continue to push myself to learn more. I truly appreciate those helping with GCC ... the original authors and all the forum specialists. Thank you.
Just my 2 cents...
Brian
you bring up a good point where you say " I came into this with fairly high expectations that the Prop GCC system would be completely self explanatory....that is be able to learn C just from the tutorials and a Prop reference manual, similar to Parallax's prior Stamp and SX processors."
I too appreciated the spiral bound book that came along with the Basic Stamp 1 in what must have been the late 90's.
I'm hoping some of the Parallax people read this, because I wonder if they do indeed desire the Propeller to be the platform to learn C for the first time on, bit by bit, with a series of simple projects to introduce the C language keywords and constructs in an organized manner. Or if it's more about helping teachers produce lesson plans. Or maybe both?