Lynxmotion Tech Support

www.lynxmotion.com
It is currently Wed May 22, 2013 1:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Oct 23, 2008 10:47 am 
Offline
Roboteer

Joined: Mon Oct 01, 2007 2:42 am
Posts: 10
Hello all! :D

I use the SSC-32 with Basic Atom28

First step in Basic... so be kind, I know my questions are really silly!

I don't understand the point of the situation...
I want a led go on and off, while the other ones does something else

I would use something like:

sequence1
low P6
pause 500
high P6
pause 500
goto sequence1

sequence2
bla bla bla bla
.....


How can I tell my program that it must execute the sequence1 forever while going on with the rest of the script?
I know that "goto" is wrong, it's just to make you understand my problem...


Any good link to suggest me? I'm on "What's a microcontroller" by Parallax.

Ciao,
Andrea


Top
 Profile  
 
PostPosted: Thu Oct 23, 2008 10:52 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
tarpaz wrote:
Hello all! :D

I use the SSC-32 with Basic Atom28

First step in Basic... so be kind, I know my questions are really silly!

I don't understand the point of the situation...
I want a led go on and off, while the other ones does something else

I would use something like:

sequence1
low P6
pause 500
high P6
pause 500
goto sequence1

sequence2
bla bla bla bla
.....


How can I tell my program that it must execute the sequence1 forever while going on with the rest of the script?
I know that "goto" is wrong, it's just to make you understand my problem...


Any good link to suggest me? I'm on "What's a microcontroller" by Parallax.

Ciao,
Andrea


The "do something else" needs to be defined in order for me to help.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2008 6:13 pm 
Offline
Roboteer

Joined: Mon Oct 01, 2007 2:42 am
Posts: 10
Thankyou for your support!

It's a general question, I want to understand if it's possible to run a part of code in loop while going on with the other code part.

I've had this great idea trying to understand the SRF08

The code is the following:


SDA Con P8
SCL Con P9
SRF08 Con 0xE0
CmdReg Con 0
LightReg Con 1
RangeReg Con 2
Light Var Byte
Range Var Word

Main
i2cout SDA, SCL, SRF08, CmdReg, [81]
pause 66
i2cin SDA, SCL, SRF08, LightReg, [Light, Range.HighByte, Range.LowByte]
Serout S_OUT, i9600, ["Light1 = 0x", HEX Light, ", Range1 = ", DEC Range, " cm, "]
goto main

Now I'd like to add some other lines of code (for example the light sequence I wrote in the first post).
Any chance I made you understand my doubt?
:oops:

Thankyou again,
ciao
Andrea


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2008 9:18 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
I am by no stretch of the imagination a programming guru. Anyone who knows this better than I do, please chime in.

Basic Stamps and Atoms run basic code in a straight line fashion. There are some tricks to get what appears to be more than one thing going at a time, but there are limits to what can be done.

The Basic Stamp is strictly interpreted. It reads a line from the program and executes it. then grabs a new instruction, etc. The Basic Atom is a hybrid of sorts as it compiles parts of the code for faster execution. The Basic Atom also has the ability to use interrupts to truly control things "in the background." Unfortunately I'm not able to provide a detailed description of how to incorporate interrupts in your sensor code. Clear as mud eh? :(

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2008 10:28 am 
Offline
Roboteer

Joined: Mon Oct 01, 2007 2:42 am
Posts: 10
no-no, remember I was darker than mud.... so you helped me!

Thankyou for your clarification, now I can stop looking for some "partial loop" instruction.....

Straight line, that's a good starting point!

Ciao,
Andrea



Robot Dude wrote:
I am by no stretch of the imagination a programming guru. Anyone who knows this better than I do, please chime in.

Basic Stamps and Atoms run basic code in a straight line fashion. There are some tricks to get what appears to be more than one thing going at a time, but there are limits to what can be done.

The Basic Stamp is strictly interpreted. It reads a line from the program and executes it. then grabs a new instruction, etc. The Basic Atom is a hybrid of sorts as it compiles parts of the code for faster execution. The Basic Atom also has the ability to use interrupts to truly control things "in the background." Unfortunately I'm not able to provide a detailed description of how to incorporate interrupts in your sensor code. Clear as mud eh? :(


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

All times are UTC - 6 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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group