After compile new errors after using the described solution
Errors have been found:
xxx.gcb (29): Error: Array/Function INT has not been declared
xxx.gcb (31): Error: Array/Function INT has not been declared
xxx.gcb (33): Error: Array/Function INT has not been declared
xxx.gcb (35): Error: Array/Function INT has not been declared
xxx.gcb (37): Error: Array/Function INT has not been declared
xxx.gcb (39): Error: Array/Function INT has not been declared
The message has been logged to the file Errors.txt.
Last edit: sfyris 2019-09-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oups sorry Anobium, just forget to remove the #defines, its ok now it works, thank you. But anyway why is this necessary, that shouldn't be. And specially to only one var, the SERVO_STEP. Why not for the others?
Last edit: sfyris 2019-09-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes sure it is usefull when writing a variable wrong accidentaly, without this option compiler assumes the wrong variable as byte and continue using it without warning. In small programs someone can easy observe what is going wrong but in bigger ones things go hard when this happens.
Last edit: sfyris 2019-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From this code (please remove the "-" signs before defines, I put them because without them text becomes weird)
;Chip Settings
-#chip 16F887,20
'Pin mappings for LCD
-#define LCD_IO 4
-#define LCD_NO_RW
-#define LCD_RW PORTB.1
-#define LCD_RS PORTB.0
-#define LCD_Enable PORTB.2
-#define LCD_Data_Port PORTD
-#define LCD_DB4 PORTD.4
-#define LCD_DB5 PORTD.5
-#define LCD_DB6 PORTD.6
-#define LCD_DB7 PORTD.7
-#define ARC 70 'επιθυμητό τόξο κίνησης
-#define SERVO_L_LIMIT 650 'δεξί όριο κίνησης (ms)
-#define SERVO_R_LIMIT 2450 'αριστερό κίνησης (ms)
-#define SERVO_L 1200
-#define SERVO_R 1900
-#define SERVO_STEP (SERVO_R - SERVO_L)/ARC
-#define SCREEN_L_LIMIT 0 'αριστερό όριο οθόνης 55
-#define SCREEN_R_LIMIT 180 'δεξί όριο οθόνης 125
-#define SCREEN_L (SCREEN_L_LIMIT + SCREEN_R_LIMIT)/2 - ARC/2
-#define SCREEN_R (SCREEN_L_LIMIT + SCREEN_R_LIMIT)/2 + ARC/2
I get the first attach, Everything ok.
But with this code (highlighted the changes):
'Pin mappings for LCD
-#define LCD_IO 4
-#define LCD_NO_RW
-#define LCD_RW PORTB.1
-#define LCD_RS PORTB.0
-#define LCD_Enable PORTB.2
-#define LCD_Data_Port PORTD
-#define LCD_DB4 PORTD.4
-#define LCD_DB5 PORTD.5
-#define LCD_DB6 PORTD.6
-#define LCD_DB7 PORTD.7
-#define ARC 70 'επιθυμητό τόξο κίνησης
-#define SERVO_L_LIMIT 650 'δεξί όριο κίνησης (ms)
-#define SERVO_R_LIMIT 2450 'αριστερό κίνησης (ms)
-#define SERVO_L (SERVO_L_LIMIT + SERVO_R_LIMIT)/2 - (ARC10)/2
-#define SERVO_R (SERVO_L_LIMIT + SERVO_R_LIMIT)/2 + (ARC10)/2
-#define SERVO_STEP (SERVO_R - SERVO_L)/ARC
-#define SCREEN_L_LIMIT 0 'αριστερό όριο οθόνης 55
-#define SCREEN_R_LIMIT 180 'δεξί όριο οθόνης 125
-#define SCREEN_L (SCREEN_L_LIMIT + SCREEN_R_LIMIT)/2 - ARC/2
-#define SCREEN_R (SCREEN_L_LIMIT + SCREEN_R_LIMIT)/2 + ARC/2
Green small creatures make me getting the second attach. If you make the maths by hand In every code SERVO_STEP has the same value (10). I give up...
oups! attachments dont upload...one more try
Try adding this to your code (Always do this!)
#option Explicit
And, if you use this editor correctly you do not have to change the code.
And, by 'hacking the code in the editor means the
ARC*10
has become ARC10....However, the answer to your issue - is use a script. Scripts are detailed in the help but they are not easy to use.
Provides... the following:
Simples....
After compile new errors after using the described solution
Errors have been found:
xxx.gcb (29): Error: Array/Function INT has not been declared
xxx.gcb (31): Error: Array/Function INT has not been declared
xxx.gcb (33): Error: Array/Function INT has not been declared
xxx.gcb (35): Error: Array/Function INT has not been declared
xxx.gcb (37): Error: Array/Function INT has not been declared
xxx.gcb (39): Error: Array/Function INT has not been declared
The message has been logged to the file Errors.txt.
Last edit: sfyris 2019-09-13
Not here....
19:48:56 G+Stool started with parameter 'asm' -> processing C:\GCB@Syn\G+Stools\makeASM.bat
Source-File = C:\temp\New95.gcb
You need to post your code as an attachment. I cannot guess what you have in the editor.
Oups sorry Anobium, just forget to remove the #defines, its ok now it works, thank you. But anyway why is this necessary, that shouldn't be. And specially to only one var, the SERVO_STEP. Why not for the others?
Last edit: sfyris 2019-09-13
OK.
I am not sure why
#define 'constant' complex_calc
does not do what you expect.But, we use
#script - #endscript
to complete the task.option Explicit
ALWAYS USED IT!
Yes sure it is usefull when writing a variable wrong accidentaly, without this option compiler assumes the wrong variable as byte and continue using it without warning. In small programs someone can easy observe what is going wrong but in bigger ones things go hard when this happens.
Last edit: sfyris 2019-09-18