Is it possible to have a 28x2 make several programs in parallel with Blockly?

Danielpbt

New Member
Hello everyone again. I'm trying to make a robot have several functionalities controlled by the bluetooth of a mobile phone, but also that if anything comes close to it, it will react, regardless of what it is doing. I guess I need several start commands, but I understand that only M2 processors can do it. I'm wrong?
Is there a processor compatible with the axe020 board that can do it?
Thanks for everything you can contribute
 

inglewoodpete

Senior Member
I am not a user of blockly (very few forum members seem to use blockly). However, since labels Start0, Start1...Start7 are only available for the M2-series chips, "multi tasking" is not available in the same way for the X2-series chips.

As I say, I have never used blockly. However, my favorite PICAXE chip is the 28X2. If you structure your program correctly, you can do multiple things with this chip. Your main program loop would just check flags or external inputs and execute subroutines/subprograms as required. Each subroutine would set or clear the flags as required. I have written quite complex programs using this method. It should be possible to do this using blockly.

Perhaps hippy or Technical can answer your question in more detail.
 

Technical

Technical Support
Staff member
Only the M2 parts do multiple starts, however that is not needed for the original project. All that is probably needed is a main 'forever' loop that scans the different inputs and processes any event as it happens.
 

Dartmoor

Member
Technical's response is true unless you need to use a "blocking command" where the program effectively stops while it is performing that function (eg "Wait")?
Usually there is another way to achieve the equivalent of a blocking function if you think hard enough.
If that does not seem practical, there is usually one interrupt allowed. I don't like using interrupts but you could use the input which is reading the range sensor to interrupt the loop and do something to avoid a collision. I have used it once as an emergency stop for a miniature train.
I also have never used blockly but do use the Picaxe flowchart system, which I understand has similarities.
Have fun!
 
Top