Phil, look in the jal compiler documentation for the "for loop" syntax.
Let say we have "for 10 loop". That means loop will cycle 10 times,
starting from 9 to 0.
Now, instead of a number, you can use a variable who contains a number.
Instead of "cascade", we can use "Phil" variable:

Phil = 10
for Phil loop
  do_something_inside_loop
end loop


On Tue, Feb 4, 2014 at 12:49 PM, phil heintz <[email protected]> wrote:

> Hello
>
> I just find a variable named in other library: cascade, I suppose
> "cascading" is cascade??? I dont understand.
> Thanks
>
> Le lundi 3 février 2014 09:49:28 UTC+1, phil heintz a écrit :
>
>> Hello
>>
>> I have this statement in this library
>>
>> -- Write two byte to the SPI bus
>> procedure spi_write_2(byte in b1, byte in b2) is
>>     spi_ce = low
>>
>>     for cascading loop                  What is the meaning of this
>> statement?   "cascading"
>>                                                  I don't find this in
>> JAl books.
>> -- byte 1, bits 8 - 1
>>     if (b1 & 128) > 0 then              Thanks a lot,   Phil
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 64) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 32) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 16) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 8) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 4) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 2) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b1 & 1) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>> -- byte 2, bits 8 - 1
>>     if (b2 & 128) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>         spi_clk = low
>>     if (b2 & 64) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 32) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 16) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 8) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 4) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 2) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>     if (b2 & 1) > 0 then
>>         spi_dao = high
>>     else
>>         spi_dao = low
>>     end if
>>     spi_clk = high
>>     spi_clk = low
>>
>>     end loop
>>
>> -- loads the new volume setting
>>     spi_ce = high
>> end procedure
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/jallib.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Vasi

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to