Basic Beginner (..better now than never...)

Hello all! :smiley:

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.

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?
:blush:

Thankyou again,
ciao
Andrea

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? :frowning:

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