Error 126 Out of Variable
silverback
Posts: 40
What is the limit of Variables on a BS2?
can't find it in any of the help files
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
can't find it in any of the help files
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Comments
26 variables
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Table 4.2 (RAM Organization for all BS2 models) and its Note describe what's available. There are a total of 32 byte-size variables, 6 dedicated for I/O. That leaves 26 available to the user.
Regards,
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How do some of you get around this limitation?
Here is the pseduo for the program I was wanting to make :
take a total of 10 Ambiet light samples (5 left, 5 right (10 Word VAR)) rotating the BOEBot between each sample;
then average each group (2 Word VAR (left Average, right Average)):
take 10 light samples with the flashlight (10 Word Var (I could reuse first 10));
the average each group (2 Word VAR):
Use the 4 averaged VARS to create 2 Threshold levels (2 Word VAR):
From there -
the program takes RCTIME readings to control the servos (based on light readings compared to the averaged thresholds.)
(this is a variation of Flashlight controlled Boebot (RCTIME) from the Robotics manual p210 (p224 PDF))
At the bare medium I need 16 Word VARs to make this happen.
Would Read\Write be a way to get the amounts of readings I want?
The idea behind this program is that I wanted to make it possible to calibrate the boebot to different areas with different light levels without re-assigning constants.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Create a VAR named workVal (name not important). Use this variable over and over again in your code anywhere that the value that it contains does not need to be retained.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
I got the program written, tested, and running.
in14 is a tac button·to start·the configuration process.
lights on 0 and 15 display operational states for testing without motors active
11 and 10 is a bi-color led (Red\Green) to display ready state
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Post Edited (silverback) : 3/1/2010 3:25:39 AM GMT
Also, I would think that you could scale the other variables. Do you really need them to be Word sized?
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
As far as Word VARS, I think I wanted cover my bases for really low light areas, On testing I got a reading of 1000 on one of the RCTime functions. But I would think that thresholds could be reduced to a byte.
Think I am going to trim up the program and add some extra error checking and ambient samples when establishing the Threshold.
thanks for the input.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.