ROBO Games medal with DS18S20 temp, Vars exceed avaliable ram
kf4ixm
Posts: 529
Hi all, i am working on interfacing a DS18S20 temp sensor to the robo games medal to scroll out the temperature. I'm using the Badge.sbx code as a building block and seeding this code with code from Bean's post,
http://forums.parallax.com/showthread.php?p=724654
I've had to take out alot of the badge.sbx animations and such, (leaving ascii and nums data) to try to free up memory. im pretty sure i haven't took out anything i need, the only errors i get are from when i try to add the 7 VARS from Beans code, telling me i've exceeded avaliable ram. if i take out the vars, it compiles and from the memory usage window, it seems like i should have enough.·here is a screenshot...
Attached is my code that i have so far. hopefully someone with more sx/b experience can tell me what im doing wrong.
Also, i haven't added the code to actually read the ds18s20 yet, i have just added the pin, con's and vars, compiling as i go to check for errors. i read in the manual that this may be due to too many variables, are there a maximum number of vars in a program, depending on if it's a bit, byte or word? I've read the thread about using an array...
http://forums.parallax.com/showthread.php?p=592633
·to overcome running out of var space, but im not sure if this would apply to what im trying to do, or if it would work, or how to go about doing it
Post Edited (kf4ixm) : 3/3/2010 7:49:44 PM GMT
http://forums.parallax.com/showthread.php?p=724654
I've had to take out alot of the badge.sbx animations and such, (leaving ascii and nums data) to try to free up memory. im pretty sure i haven't took out anything i need, the only errors i get are from when i try to add the 7 VARS from Beans code, telling me i've exceeded avaliable ram. if i take out the vars, it compiles and from the memory usage window, it seems like i should have enough.·here is a screenshot...
Attached is my code that i have so far. hopefully someone with more sx/b experience can tell me what im doing wrong.
Also, i haven't added the code to actually read the ds18s20 yet, i have just added the pin, con's and vars, compiling as i go to check for errors. i read in the manual that this may be due to too many variables, are there a maximum number of vars in a program, depending on if it's a bit, byte or word? I've read the thread about using an array...
http://forums.parallax.com/showthread.php?p=592633
·to overcome running out of var space, but im not sure if this would apply to what im trying to do, or if it would work, or how to go about doing it
Post Edited (kf4ixm) : 3/3/2010 7:49:44 PM GMT
SXB
21K
Comments
owStatus VAR BYTE (1)
owTempLSB VAR BYTE (7)
owTempMSB VAR BYTE (7)
DegSign VAR BYTE (1)
DegreesC VAR BYTE (7)
DegFrac VAR BYTE (7)
P1 VAR BYTE (1)
and those ram errors went away (not to say they're correct)·during compile, now i added the rest of the ds1820 code and imcoming up with multiple invalid parameter errors...
Any ideas? also attached is the updated code. i suspect it's because of how i declared the vars as an array, and i need to do lookup/lookdown on those vars now in order to extract data, can someone confirm this? (or debunk as the case may be?)
Post Edited (kf4ixm) : 3/3/2010 9:32:19 PM GMT
FWI- I'm no Guru, just a student like you trying to understand the SX and programming in general.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Post Edited (kf4ixm) : 3/4/2010 3:12:43 PM GMT
owTempLSB··· VAR·· BYTE (8)
·
I refuse to give up now, i know it looks like im just throwing stuff at it and seeing what sticks, and in a way i am, but i want to understand how the code works, or don't and if it don't why it doesn't.
BTW, yes this is my first SX/b Program, im letting my brain rest from the propeller at the current time.
Post Edited (kf4ixm) : 3/4/2010 4:03:48 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Ughh, i think my brain is bleeding... ok, back to the prop!