Here are the errors, what the heck, how can start values be to big with loopcounter starting at 0 ?????
Line 11 is * For LoopCounter = 1 to 6* which is what the errors are refering to.
1.2 Sec. <<< WARNINGs / ERRORs while compiling!
Doubleclick on errormessage below to go to sourcecode-line:
NextStepTest.gcb (11): Error: For start value is too big for the counter
NextStepTest.gcb (11): Error: For end value is too big for the counter
NextStepTest.gcb (11): Error: Missing operand, before +
Last edit: Paul Haug 2017-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
LoopCounter is a variable. So use DIM instead of define. Define makes it a constant that cannot change.
#chip16F88,8
#configOsc=Int
#optionexplicit
#defineLEDPORTB.0'// #define LoopCounterDIM LoopCounter as Byte Dir LED OutFor LoopCounter = 1 to 6 PulseOut Led, 1 s Wait 1 sNext
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many thanks again William, old habits carry over from other basics need to be re-trained. I wil add this to my notes.
The three errors msgs were a little strange, but now I understand why they said that.
Paul
Last edit: Paul Haug 2017-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
William, would it be a problem if I used Dim instead of Define for all variables, even unchanging variables, except of course Define for all iI/O should be Define ?
Thanks my friend
Paul
Last edit: Paul Haug 2017-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DIM will assign a memory location (Static RAM) . How much is assigned depends upon the varible type.
Never use #define with a variable that needs to change.
Define tells the compiler to replace one thing with another thing and uses no memory.
For Example. #define ABC 16 will make ABC a constant with a value of 16. So is good when the value will never change.
Another Example. #Define Led_On Set PortC.1 On
If you then place Led_On in the basic source code, the compiler will replace Led_on with
"Set PortC.1 On" at compile time and the equivalent of "Set PortC.1 on" will be put into the ASM code .This is a sneaky way to make a simple macro.
Another example #define pulsout pulseout
Now you do not have to worry about misspelling "pulseout" with the Picaxe version of pulsout (no "e")
Last edit: William Roth 2017-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, this is very helpful. I am also reading a lot of sample programs and help files (many of which you have posted) and beginning to undersdtand the "gotchas' in gcb. I am waiting to get my pickit3 so I can start debuging some programs as I expand and add to my main program.
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This code gives me errors, I have been trying to isolate but no avail.
.
Here are the errors, what the heck, how can start values be to big with loopcounter starting at 0 ?????
Line 11 is * For LoopCounter = 1 to 6* which is what the errors are refering to.
Last edit: Paul Haug 2017-03-04
Hi Paul,
LoopCounter is a variable. So use DIM instead of define. Define makes it a constant that cannot change.
Many thanks again William, old habits carry over from other basics need to be re-trained. I wil add this to my notes.
The three errors msgs were a little strange, but now I understand why they said that.
Paul
Last edit: Paul Haug 2017-03-04
William, would it be a problem if I used Dim instead of Define for all variables, even unchanging variables, except of course Define for all iI/O should be Define ?
Thanks my friend
Paul
Last edit: Paul Haug 2017-03-04
DIM will assign a memory location (Static RAM) . How much is assigned depends upon the varible type.
Never use #define with a variable that needs to change.
Define tells the compiler to replace one thing with another thing and uses no memory.
For Example. #define ABC 16 will make ABC a constant with a value of 16. So is good when the value will never change.
Another Example. #Define Led_On Set PortC.1 On
If you then place Led_On in the basic source code, the compiler will replace Led_on with
"Set PortC.1 On" at compile time and the equivalent of "Set PortC.1 on" will be put into the ASM code .This is a sneaky way to make a simple macro.
Another example #define pulsout pulseout
Now you do not have to worry about misspelling "pulseout" with the Picaxe version of pulsout (no "e")
Last edit: William Roth 2017-03-04
Thanks, this is very helpful. I am also reading a lot of sample programs and help files (many of which you have posted) and beginning to undersdtand the "gotchas' in gcb. I am waiting to get my pickit3 so I can start debuging some programs as I expand and add to my main program.
Paul