BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 11:59 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: adin16 unexpected token type Nano28
PostPosted: Sun Jan 15, 2012 11:26 am 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
At the beginning of the program

Code:
press var word
press var word


And in the main part of the program

Code:
Read         ;acquires data for display
   adin16 p18, press   ;gets a reading from transducer
   pause 100
   adin16 p18,press2   ;gets a 2nd consecutive pressure reading
   peak = press2 - press1   ;gets difference in two consecutive readings
   serout s_out, i9600,[0,"press1,"___" press2,"___" delta"]   ;display data for debug purposes?not sure about the 0


results in "ADIN16 unexpected token type"

I cannot see what I am doing? Any suggestions?


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Sun Jan 15, 2012 11:32 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 527
From your post press is defined twice and press2 is not defined... Not sure if that is it or not.

Kurt


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Sun Jan 15, 2012 12:05 pm 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
No, I just entered it wrong here when I typed it. Definitions are press and press2 but ...

You did raise a good point and I had made a couple naming errors, ie press, press1 and press2 so I cleaned that up....but still errors..

the "Read" line is #48
I commented out #49 and then got the same error for line 50
I did the same for #50 and got the same error, "Unexpected Token type" for line #51

Does that help?

Also, is there a way in Studio to display the line numbers down the left side? I found the line indication in the lower right corner but would prefer the lines indicated in the coding window, if possible. I could not find a setting anywhere.

Thanks
:)


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Mon Jan 16, 2012 8:02 am 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
Found it !! :)

I used the word "Read" as a label. Can't do that..to find it, I copied that part of the program to another spot in the program and it passed fine so the problem had to be in the Read line ...duh, only one word in the "Read" line.. :oops:

Now I have to do the wiring to see if it actually works..


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Mon Jan 16, 2012 11:06 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Ya. Got to be carefull with the reservered words. Some of them are very easily used as label names(Read being a good example).

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Mon Jan 16, 2012 1:37 pm 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
Thanks Nathan

So, is there a way to display line numbers in Studio?


Top
 Profile  
 
 Post subject: Re: adin16 unexpected token type Nano28
PostPosted: Mon Jan 16, 2012 8:42 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Sorry, we dont have printed line numbers implemented in the editor.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO