Ah3r1gen.bas compile errors

Hi,
I’ve been trying to compile ah3r1gen.bas and I’m getting a “Tokenization” error on lines 88, 89, 90. Has anyone run across this? I have the Basic Atom Pro 28

Thanks,
Deron

Hi ddragon,

post a link to the code, and i will see, what we have there…

greets

Thanks Marc,
here you go:

lynxmotion.com/images/files/ah3r1gen.bas

Cheers,
Deron

Your problem is in the fact that you are trying to program the Atom Pro with Atom code. There are some syntax issues that prevent them from being truely compatible. Although you can probably get the code to work with the Pro there are hardware limitations that will prevent the Pro from talking to the Play Station game controller. The Pro chip has some 3.3vdc I/O pins and they happened to fall on the PS2 game controller interface. It will be necessary to use I/O pins 12-15 instead of 4-7. Please see this thread fopr more information.
lynxmotion.net/viewtopic.php?t=159
Honestly this program is really advanced. You may be much better off in the long run going with the Atom 28 instead. Thanks…

LOL… now you tell me. I already bought the Atom Pro 28 and all the hardware and servos! :slight_smile: Actually, I didn’t want to use the PS2 controller… just want to get the puppy to walk.

OK… got it compiled. Was able to replace the troublesome code with the AtomBasic Pro code. I order more parts, so once I have this puppy walking in a straight line I’ll post the code for public consumption.

The goal is to make it atonomous with a rotating PING sensor on the top or front.

Hello Ddragron,
Hey you have deleted too fast the topic about this below…take a look

Basic Atom Syntax (using the internal 256Bytes EEPROM) :

[code];ACos
data 64,64,63,63,63,62,62,62,61,61,61,60,60,60,59,59,|
59,59,58,58,58,57,57,57,56,56,56,55,55,55,54,54,|
54,53,53,53,52,52,52,51,51,51,50,50,50,49,49,49,|
48,48,48,47,47,46,46,46,45,45,45,44,44,44,43,43,|
42,42,42,41,41,41,40,40,39,39,39,38,38,37,37,37,|
36,36,35,35,35,34,34,33,33,32,32,31,31,31,30,30,|
29,29,28,28,27,27,26,25,25,24,24,23,23,22,21,21,|
20,19,19,18,17,16,15,15,14,13,11,10,09,07,05,00

TmpCos var Byte
TmpAngle var Sbyte


; put the Cosine in TmpCos
gosub ACos
; TmpAngle is the result

;-------------Sub Arc Cosinus
ACos
if TmpCos < 0 then
read -TmpCos,TmpAngle
TmpAngle = 128 - TmpAngle
else
read TmpCos,TmpAngle
endif

return[/code]

Basic Atom Pro syntax (not using the external EEPROM but the program’ flash memory) :

[code];ACos
ArcCos Bytetable 64,64,63,63,63,62,62,62,61,61,61,60,60,60,59,59,|
59,59,58,58,58,57,57,57,56,56,56,55,55,55,54,54,|
54,53,53,53,52,52,52,51,51,51,50,50,50,49,49,49,|
48,48,48,47,47,46,46,46,45,45,45,44,44,44,43,43,|
42,42,42,41,41,41,40,40,39,39,39,38,38,37,37,37,|
36,36,35,35,35,34,34,33,33,32,32,31,31,31,30,30,|
29,29,28,28,27,27,26,25,25,24,24,23,23,22,21,21,|
20,19,19,18,17,16,15,15,14,13,11,10,09,07,05,00

TmpCos var Byte
TmpAngle var Sbyte


; put the Cosine in TmpCos
gosub ACos
; TmpAngle is the result

;-------------Sub Arc Cosinus
ACos
if TmpCos < 0 then
TmpAngle = 128 - ArcCos(-TmpCos)
else
TmpAngle = ArcCos(TmpCos)
endif

return[/code]

Yeah yeah i can hear : “Why not using the Atom Pro EEPROM ?”

good question !

The Basic Atom 256Bytes EEPROM is reachable by the Atom IDE during the program download to the chip…so, when the downloader meet the “data” function, it write the bytes to the EEPROM

but

The Basic Atom PRO EEPROM is not reachable by the Atom Pro IDE…only the BA Pro chip can read and write to it, because the EEPROM is not included on the BA Pro chip => it’s an external EEPROM memory !
so, using Bytetable function is the only way in this case…

…not exactly in fact…there’s another way…a bit more complex 8)
you can download to the BA Pro a “first” program containing the Byte table and the code to write it to the EEPROM memory (with the “Write” function)
(run this first program one time to write to the external EEPROM)
then, you can download the “real” program with no bytetable…using the “read” function to access the previously saved Acos data…
first, a program to write the EEPROM, then a program to read 'em !
The benefit ? the ACOS data are written to the EEPROM one time only, and the “real” program is taking less Flash memory

i hope it help :wink:

LOL… thank you. I thought I had the answer to the question I deleted, then I tried it last night and found I didn’t. But you answered my question before I could ask it!

I’ll try this tonight and let you know how it worked out!

Cheers,
Deron

Boy, I’m glad that I don’t have to figure out what that means!
:laughing: