I think the best way to learn spin is Sphinx from @MPark.
It's way old (about 10 years) so you have to search for it in this forum, or @publison can chime in and provide his magic to find links to older stuff here.
It is a complete development system running on a Propeller with serial terminal or VGA and keyboard, including editor and spin-compiler.
It is almost like being back in the 80's except you have 32 bits not 8.
Edit, compile and run spin programs directly on the p1.
But I think that on a P2 it is be possible and desirable to have a complete Development System on it. You also work on a Editor in FORTH because it is simply tempting to be able to do that.
Discovering the Propeller with Sphinx was almost as interactive as FORTH is, more like a TRS80/Atari/... Edit compile run.
But I have to admit that @Mpark definitely hooked me up with the Propeller, even if I do not have any NEED for micro-controllers in my life. It just gives me a lot of fun to play around with it, compared to the more boring daily tasks I have to do to earn my living.
But lately I do not use Spin much anymore, programming in Assembler makes more fun to me.
To be perfectly honest I'm attempting to learn SPIN for the enjoyment of learning something new, plus I have dozens of projects that I could apply this to.
When I was (much) younger I attempted assembly language and did fairly well at it, but with age comes memory loss and since I never used it I lost it.
It used a few of the library objects. Probably about 6-7 cogs, but was done over a weekend and about $75 in parts I had laying around.
SPIN is an amazing language and has a ton of power.
Now getting into assembly on the Prop can be a bit more challenging, but easier than on many other chips.
Have fun and enjoy the experience. Don't be afraid to ask questions. This forum is full of some of the most knowledgeable and friendly people I have met.
Thank you Jim Fouch. You're right about the knowledgeable and friendly people on this site and I'm not even a little bit shy so I will be asking tons of questions.
I have several hardware projects that I've been fiddling around with so now I have the ability to add software to my projects, I'm very excited. I will be choosing one this weekend then I will sit down and do a layout as to what I'm looking from my hardware and software to achieve the perfect marriage between the two. Once I achieve this I will be ready to start programming.
This is when the questions will start flowing.... I've already thought about how I'm going to have difficulty in the actual layout of my program since I have NO programming experience. In the book that I'm practicing with they give a basic layout of the (rules) that most programmers follow, but other then those few rules I haven't the foggiest idea of how to start.
Think of some really small simple part of whatever it is you want to do and start writing code for it.
Then think of another part and write code for that.
Eventually you may or may not finish the project and it may or may not work. Depending how complex it is.
Either way, you will likely end up with an ugly, tangled mess of code that you hardly understand anymore. Is difficult to modify or add to. And probably has lots of bugs.
With that experience you will start to see how things can be structured (laid out) better.
Then, with your new experience, write it all again.
As the famous software engineer Fred Brooks said:
The management question, therefore, is not whether to build a pilot system and throw it away. You will do that. […] Hence plan to throw one away; you will, anyhow.
Heater: I was going to ask how the best way to lay it out but you seemed to have answered my question. Plan on doing it wrong the 1st time, but hopefully I will have learned a thing or two from the experience so I will be better suited when I fail the 2nd time. I'm going to start this weekend and hopefully by Monday I will have a Smile load of questions.
I have a project in mind that may be a good fit. I have a Greenhouse that I would like to automate. Temperature, moisture of soil, water, fail safes, ect.
When your project is done and dusted you may come back and look at the code again months or years later, for whatever reason. At that point you will throw your arms in the air and shout "What idiot wrote this pile of sh...". Then humbly think "Oh, it was me."
Programming messes with your mind that way.
The greenhouse project sounds great.
That is already three or four sub-projects: Temperature, moisture, fail safe, etc.
How about starting with temperature. Say. That is already three sub-sub-projects: Measuring the temperature. Making the temperature change by heating and or cooling. Creating a control system that uses the first, measurement, to drive the second, heating and cooling.
Perhaps even four sub-sub-projects. You might want to record temperature over time so that you know the thing is working!
Heater: You are absolutely right. I've already been contemplating those very facts. (1) Temperature: I want to measure and display temperature. I want to turn on/off fans to circulate air depending on temperature. create a warning (alarm) if temperature is exceeded, etc. So even this first part has several sub parts.
I will attempt the code this weekend then I will post the failure on Monday. The beauty of it is the worst I can do is not succeed, hell that's the story of my life. If not for failure I wouldn't have a middle name.
No problem. That code works with inexpensive temperature and humidity sensors, the DHT 11 and the DHT 22. Both are easy to find on eBay and Amazon and can get you started.
Saturday morning and I am now starting to attempt programming in spin language. I can already tell that this is going to be a real pain in my butt, but I'm going to give it a good college try. I was just thinking about this simple project that I picked to attempt programming with spin and realized that this little project was extremely large and it was going to require an immense amount of code to write so this should be very interesting to say the least.
I don't get any warnings on this page using Firefox, but the embedded video link doesn't show anything other than just a large amount of white space were the video should be. When I look at the page source code I found the video link which doesn't look like it works and really should be this link, which does appear to work showing the project in question "Parallax Propeller used to make a Motorcycle Instrument Display".
The LM34 has been used for years for temperature control but I see Parallax no longer carries it and the DS1620 Digital Thermometer is also being phased-out. The LM34 needs and ADC which the Activity and Education boards both have. Some of the newer sensors also have temperature measurement built in.
A 7-segment display is not difficult to use or you could use the common 2x16 LCD.
You can use a transistor, MOSFET, or a Relay to control a fan depending on how much power it uses.
I don't know what legacy parts you have access to since they Spin code may already exist.
Genetix, I do have access to any and all products at Parallax, as for legacy parts I'm not sure but I will look into it.
My goal is to write all of the code and not depending on code that someone else has written.
Comments
It's way old (about 10 years) so you have to search for it in this forum, or @publison can chime in and provide his magic to find links to older stuff here.
It is a complete development system running on a Propeller with serial terminal or VGA and keyboard, including editor and spin-compiler.
It is almost like being back in the 80's except you have 32 bits not 8.
Edit, compile and run spin programs directly on the p1.
just wonderful.
Mike
http://www.sphinxcompiler.com/
To print Hello World 10 times just connect a terminal and type:
or run a blinky on P15
that is sort of mean.
But I think that on a P2 it is be possible and desirable to have a complete Development System on it. You also work on a Editor in FORTH because it is simply tempting to be able to do that.
Discovering the Propeller with Sphinx was almost as interactive as FORTH is, more like a TRS80/Atari/... Edit compile run.
But I have to admit that @Mpark definitely hooked me up with the Propeller, even if I do not have any NEED for micro-controllers in my life. It just gives me a lot of fun to play around with it, compared to the more boring daily tasks I have to do to earn my living.
But lately I do not use Spin much anymore, programming in Assembler makes more fun to me.
Mike
When I was (much) younger I attempted assembly language and did fairly well at it, but with age comes memory loss and since I never used it I lost it.
It used a few of the library objects. Probably about 6-7 cogs, but was done over a weekend and about $75 in parts I had laying around.
SPIN is an amazing language and has a ton of power.
Now getting into assembly on the Prop can be a bit more challenging, but easier than on many other chips.
Have fun and enjoy the experience. Don't be afraid to ask questions. This forum is full of some of the most knowledgeable and friendly people I have met.
I have several hardware projects that I've been fiddling around with so now I have the ability to add software to my projects, I'm very excited. I will be choosing one this weekend then I will sit down and do a layout as to what I'm looking from my hardware and software to achieve the perfect marriage between the two. Once I achieve this I will be ready to start programming.
This is when the questions will start flowing.... I've already thought about how I'm going to have difficulty in the actual layout of my program since I have NO programming experience. In the book that I'm practicing with they give a basic layout of the (rules) that most programmers follow, but other then those few rules I haven't the foggiest idea of how to start.
What you have to do is just start.
Think of some really small simple part of whatever it is you want to do and start writing code for it.
Then think of another part and write code for that.
Eventually you may or may not finish the project and it may or may not work. Depending how complex it is.
Either way, you will likely end up with an ugly, tangled mess of code that you hardly understand anymore. Is difficult to modify or add to. And probably has lots of bugs.
With that experience you will start to see how things can be structured (laid out) better.
Then, with your new experience, write it all again.
As the famous software engineer Fred Brooks said:
The management question, therefore, is not whether to build a pilot system and throw it away. You will do that. […] Hence plan to throw one away; you will, anyhow.
https://en.wikiquote.org/wiki/Fred_Brooks
When your project is done and dusted you may come back and look at the code again months or years later, for whatever reason. At that point you will throw your arms in the air and shout "What idiot wrote this pile of sh...". Then humbly think "Oh, it was me."
Programming messes with your mind that way.
The greenhouse project sounds great.
That is already three or four sub-projects: Temperature, moisture, fail safe, etc.
How about starting with temperature. Say. That is already three sub-sub-projects: Measuring the temperature. Making the temperature change by heating and or cooling. Creating a control system that uses the first, measurement, to drive the second, heating and cooling.
Perhaps even four sub-sub-projects. You might want to record temperature over time so that you know the thing is working!
http://obex.parallax.com/object/837
I helped Walt test it and recently used it to measure temperature during the eclipse.
Every time I load it Chrome warns me of some malware infested flash file that gets downloaded, which I always discard. It's in Jim Fouch's post above.
Not only that, but looking at the source code to this page I see that the flash file in question is embedded in an <iframe>
All very suspicious.
The LM34 has been used for years for temperature control but I see Parallax no longer carries it and the DS1620 Digital Thermometer is also being phased-out. The LM34 needs and ADC which the Activity and Education boards both have. Some of the newer sensors also have temperature measurement built in.
A 7-segment display is not difficult to use or you could use the common 2x16 LCD.
You can use a transistor, MOSFET, or a Relay to control a fan depending on how much power it uses.
I don't know what legacy parts you have access to since they Spin code may already exist.
There was a BS2 (BASIC Stamp 2) text called Industrial Control that showed how to Temperature Control.
http://laspace.lsu.edu/aces/Document/Parallax Docs/Industrial Control.pdf
It also uses a transistor and MOSFET to control a small PC-type fan.
Very strange indeed.
My goal is to write all of the code and not depending on code that someone else has written.
I don't get the malware warning with Firefox, but I do get a flash file download request. Definitely something odd with that post.
Looking at the page source code I notice that a typical video link around here looks like this: But Jim's FLASH malware link looks like this: Surely we don't use iframes around here? They are commonly regarded as a security problem. What is going on?
The actual link should be:
Video links inside [code] tags get rendered inline into the code!
See if Jim's original post works better now.