ADIN (Pro 24-M) Help! I'm desperate

Hi!

I am in need of some kind help please. I have the red Atom Pro-24M, and for the life of me cannot get the ADIN command to work.

  1. I cannot get the compiler to accept

ADIN AX0,funny

It expects a number (the pin) instead of AX0

Can someone please help me with this simple line? Please??

Thanks!

Peter

The Atom Pro 24 uses pin 0-3 instead of AX0-3

so try

ADIN 0,funny

instead

Thanks for the very prompt reply! I have tried that as well, but no luck either. The affected code looks like this (I’m using debug to see what is going on, and then sending the results to SSC-32)

[code]Main

planepitch var word
planeroll var word
planepitch1 var word
planeroll1 var word

starto

adin ax0,planepitch1 '0-1023, middle 512
adin 3,planeroll1

If planepitch1>650 then
planepitch=planepitch+10
Endif

If planepitch1<480 then
planepitch=planepitch-10
Endif

debug [dec planepitch1,dec planeroll,13]

serout p15,i38400,"#3P",dec planepitch,"#4P",dec planeroll,13]

Goto starto[/code]

Well, if that code is what you just tried, then you still have an ax0 in there :unamused:

Also, you have planepitch=planepitch-10 and planepitch=planepitch+10, but you never define what they are to begin with. I’m not sure if that would cause problems or not

I haven’t used debug much. I find using a serout command to be much more reliable. To use it you click on terminal1 then select the baud rate then click connect.

So, maybe you could try something like this:

[code]

planepitch var word
planeroll var word
planepitch1 var word
planeroll1 var word

planepitch = 0 'set these to center
planeroll = 0

main

adin 0,planepitch1 '0-1023, middle 512
adin 3,planeroll1

If planepitch1>650 then
planepitch=planepitch+10
Endif

If planepitch1<480 then
planepitch=planepitch-10
Endif

serout s_out,i38400,[dec planepitch1,dec planeroll,13]

serout p15,i38400,"#3P",dec planepitch,"#4P",dec planeroll,13]

Goto main[/code]

Also, what version of the IDE are you using? Try using version 8.0.1.7 if you’re not already

If you add in the min and max commands it will prevent the values from going out of bounds.

[code]

planepitch var word
planeroll var word
planepitch1 var word
planeroll1 var word

planepitch = 1500 'set these to center
planeroll = 1500

main

adin 0,planepitch1 '0-1023, middle 512
adin 3,planeroll1

If planepitch1>650 then
planepitch=planepitch+10 max 2000
Endif

If planepitch1<480 then
planepitch=planepitch-10 min 1000
Endif

serout s_out,i38400,[dec planepitch1,dec planeroll,13]

serout p15,i38400,"#3P",dec planepitch,"#4P",dec planeroll,13]

Goto main[/code]

:smiley:

Thanks James, Jim, it works! Your kind help is really awesome, will stay loyal to Lynxmotion!

:smiley: