
leonardo46
Italy
Asked
— Edited

I'm a basic and assembler programmer ( PIC MCUs). I'm trying to put ezb scripts at work. I have a pot connected to adc0 (i.e. 0-3.3 V) and move the pot. I write this easy script in movement script, triggered by "forward" action panel :
sayezbwait("man") :auto $av=getadc(adc0) if $av>20 sayezbwait("dog") else sayezbwait("cat") endif goto(auto)
"man" is spoken once. Nothing else happens. I should have missed some banal detail Please help.
I think I corrected the flow errors. Here is the new version. It's not yet working. I don't know which are the statement errors. Something case sensitive ?
I've found that EZ Script is not case sensitive.
Also, line 26 & 27 look odd to me. I'm not sure you should have a label inside an '"If" statement.
Leonardo,
Quick feedback.
Dave is right, that is one of the "flow structure errors" if, elseif, else blocks work as logical block.
I understand why you made the mistake, assembly language don't have restrictions to jump to an address.
Leonardo,
Can you try this script:
I didn't tested, i just followed your specs. Let me know if it works.
sometimes reading multiple ultrasonic sensors can create interference, but it depends how you setup them (angles).
No,ptp, it doesn't work. It starts and stops randomly the motors in the forward direction, sensors seem not influncing what's going on.To make it do something you have to click more than once the forward button in the movement panel. No interference among sensors. The same robot with a PIC it worked well.
Leonardo,
Can you try this variant:
Leonardo,
Did you tried the script ?
I'm writing .It's a long job. By the way, is there some way to import your code to my ARC without writing it, i.e. such as a sort of executable file ?