Can't find this strange code in the manual

William Elwell

New Member
In one of the posts here there is an electric candle. I don't understand the fourth line in the code below. What does [if light < 60 then led] do? What is < 60?
[
init:
b2 = 200
symbol light = b3

main:
readadc 1,light
'debug light
if light < 60 then led
pwmout 2,0,0
nap 5
goto main

led:
random w0
if b0 < 130 then default
pause 150
pwmout 2,b0,b2
if b1 < 130 then default
pause 150
pwmout 2,b1,b2
readadc 1,light
'debug light
if light > 90 then main
goto led

default:
pause 150
pwmout 2,180,b2
pause 150
pwmout 2,220,b2
readadc 1,light
'debug light
if light > 90 then main
goto led
]
 

BeanieBots

Moderator
Looks like an old posting that might have become corrupt when it was tranferred from the old forum to this one.

Without spending time going through it all, looks as if "&lt;" should probably be "=N" or ">N" or "<N" or similar, where N is some number.
 

westaust55

Moderator
Looks like an old posting that might have become corrupt when it was tranferred from the old forum to this one.

Without spending time going through it all, looks as if "&lt;" should probably be "=N" or ">N" or "<N" or similar, where N is some number.
I agree with BeanieBots,

My first guess is that:
1. &lt should be replaced with <
2. &gt should be replaced with >
 

Rickharris

Senior Member
Just to add to this the easiest way to make an LED flicker like a candle is to use the tune command and replace the speaker/piezo transducer with an LED the music signals will make it flicker quite realistically.

i understand this is how the commercial products work.

This is in a post somewhere but i couldn't find it so don't know who to credit.
 

hippy

Ex-Staff (retired)
You'll also encounter &quot; at times ( " - a single character ) and things in angle brackets like <code> etc. These are what are now replaced by square bracket tags, eg [code]. That chevrons ( angle brackets ) used to indicate code tags is why they got converted to &gt; and &lt; for programs as in HTML as inglewoodpete notes.
 
Top