More help understanding cogs and including other SPIN files in program.
eagletalontim
Posts: 1,399
Basically, I need to have a cog that will run one code all the time which will update a variable on my main function. I am a little confused on the stacks and stuff like that for each cog.
I am also trying to understand how adding a pre existing SPIN file to my program works. Do i just add it to my list in the top left of the screen and call each function in my main program? I tried to figure that part out on my own, but that did not work too well.
Last but not least, I was wondering if the Propeller can take a preset variable, lets say variable Mytrims, and save it to the EEPROM that is used for the program. Each time the propeller boots up, the variable "Mytrims" will be loaded based on the last amount it was set at in the previous run time.
Example :
First start up (default value):
Mytrims := 1
The variable is changed to Mytrims := 6 during run time and then the car is shut off.
Next boot : Mytrims := 6 (pulled from EEPROM as last saved value)
Same senario as #1
EDIT : One more thing......
When running a single Red, 7 segment display, is it necessary to use resistors from the pins since the voltage from the Propeller is much lower than the SX? Is so, what size do I need?
Post Edited (eagletalontim) : 10/31/2009 1:11:55 PM GMT
I am also trying to understand how adding a pre existing SPIN file to my program works. Do i just add it to my list in the top left of the screen and call each function in my main program? I tried to figure that part out on my own, but that did not work too well.
Last but not least, I was wondering if the Propeller can take a preset variable, lets say variable Mytrims, and save it to the EEPROM that is used for the program. Each time the propeller boots up, the variable "Mytrims" will be loaded based on the last amount it was set at in the previous run time.
Example :
First start up (default value):
Mytrims := 1
The variable is changed to Mytrims := 6 during run time and then the car is shut off.
Next boot : Mytrims := 6 (pulled from EEPROM as last saved value)
Same senario as #1
EDIT : One more thing......
When running a single Red, 7 segment display, is it necessary to use resistors from the pins since the voltage from the Propeller is much lower than the SX? Is so, what size do I need?
Post Edited (eagletalontim) : 10/31/2009 1:11:55 PM GMT
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
you have to be more soecific in your description if others should understand what you mean.
"Do i just add it to my list in the top left of the screen..."
I guess you mean the propellertool. But in the top left of the screen I have a white space. In the middle I have subfolders and middledown left files are listed
But that's it not. Are you using the latest version of the propellertool V1.2.6 ? Did you take a look into the PE-Kit Lab ?
see attached picture
It doesn't matter which board you have. With all kinds of propeller-boards like Protoboard, PPDB, Demoboard, PropRPM, or Propstick
with all of them you can work through the PE-Kit Lab. Start reading there. If you have questions just post them here in the forum.
Depending on the board you use you have to set up small hardware like an LED with current-limiting resistor
a button with pull-down-resistor. But then everything works.
You wrote that you made a try to use another spin-file.
create a zip-archiv from your spin-files and attach them to a posting see attached picture
I recommend to learn some basics about objects and cogs and then start looking into I2C.drivers to store values in the EEPROM
best regards
Stefan
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf
maybe I'm wrong. I got the impression that you are working "quick & dirty" and ask for very basic things that are "homework"
So my hint is only:
search through the object exchange. Don't know what it is ? Go googling and find out
best regards
Stefan
"Written in Asm this LED Sequencer in one cog is also usable as an I/O controller or simple logic pattern generator. Suitable for such projects as animated displays and simple control systems. Demo works with either Demo board or PropRPM."
I tried engine, tach, square wave and nothing matched what I need.
You did a search (your "homework") and I will add some more points.
"learning how to fish": if very close related words don't give a hit. Try more fare away related words like "frequency", "pulselength", "sensor"
and use PARTS of words like "freq" which gives more hits. Be inspired by the hits about NEW words that you did not think of.
here you can get the search-result of search-word "freq"
Of course I'm in advantage as I do a almost daily look into the obex what is new uploaded and download almost everything. So I know there are some other objects.
Therefore I use a pre-defined bookmark that sorts all entries by columm published descending. So I see always the newest objects on top
http://obex.parallax.com/objects/?o=0&ot=dsc
best regards
Stefan