Help for beginer in robo pro

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
Orangebox
Beiträge: 6
Registriert: 14 Feb 2022, 23:36

Help for beginer in robo pro

Beitrag von Orangebox » 14 Feb 2022, 23:50

Hello,
I am building simple traffic light program with arduino, microbit, raspberry and fischertechnik.
I have build and programmed all but have problem with programing fischertechnik in robo pro.
In program it should be traffic light change process and when the button is pressed it should change to pedestrian crossing. And i have mannaged to program this simple thing but there is speed trap and when the car is speeding it needs to stop process imidietly and change to red light. So i dont know how to stop process when the input is for speeding. Can it be solved with multiple processes or maybe with timers instead of wait in traffic light change process? And how to do that? Thank you.

Benutzeravatar
elektrofuzzis
Beiträge: 212
Registriert: 25 Jun 2016, 09:40

Re: Help for beginer in robo pro

Beitrag von elektrofuzzis » 15 Feb 2022, 07:50

Hi Orangebox,

both options are possible, but I think using threats is a little bit more difficult.

I think you need something like that:
traffic_lights.PNG
traffic_lights.PNG (85.88 KiB) 2792 mal betrachtet
Best,

Stefan

Orangebox
Beiträge: 6
Registriert: 14 Feb 2022, 23:36

Re: Help for beginer in robo pro

Beitrag von Orangebox » 15 Feb 2022, 08:37

Thank you for fast answer. The problem is that red light needs to be on 5s then yellow 1sec and green 5sec and yellow again 1sec then red and this need to be in loop for cars going in other way is easy since when is red for one way there is green on the other. When you hit switch it should start pedestrian light sequence. Then when car is speedin the program should stop and run red light for that car. The problem is that i dont know how to make it immidietly i mannaged to make speed trap but it only starts when sequence is over.

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Help for beginer in robo pro

Beitrag von vleeuwen » 15 Feb 2022, 09:20

RoboPro is about workflow processes with data flow for the synchronization between the different processes.
This is the concept for tackling a problem.
This concept is essentially different from concepts such as imperative or functional programming.

Developing a good understanding of what workflow means is the first step.

So the question for your problem could be:
Which workflow processes can be distinguished and what is the data flow that should ensure the synchronization?

First, the problem should be clearly described (step 1). Without a good problem description there can be no solution.

Thereafter:
Which work flows can be distinguished in this problem?
And what data flow can be discovered in this problem?

Closing:
With which RoboPro elements can this solution be built.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Orangebox
Beiträge: 6
Registriert: 14 Feb 2022, 23:36

Re: Help for beginer in robo pro

Beitrag von Orangebox » 15 Feb 2022, 09:33

Hello, thank you for fast answer. Let me explain my problem with another problem.
Problem is making running light with 8 lights. Where every light lights up for 0.5s.
The problem is simply 1light goes on then whait 0.5s ant then goes off and second one goes on etc...
Now what i want to build switch that stops program but i dont want to wait until running light sequence is over i want to stop immedietli when i press the button.

Benutzeravatar
elektrofuzzis
Beiträge: 212
Registriert: 25 Jun 2016, 09:40

Re: Help for beginer in robo pro

Beitrag von elektrofuzzis » 15 Feb 2022, 13:05

Hi,

you could use two threads doing the job and synchronize both threats using a global variable used as a semaphore. Works perfect, but there is a risk on headaches reading the flowchart.

Second option is a little more the arduino loop idea. My flowchart this morning is based on that idea. But you problem is the timing of the lights.

If you use classic robopro timers, you aren't able to do anything until the delay has finished. At this point you are back with the two synchronized jobs (see above).

As a second option, there is a timer variable in robopro. It could run a countdown without blocking you code. You could read that timer whenever you want and descide on the results. So you're able to "loop on" while you are waiting on your counter.

Both solutions are fine. The first one is more thinking in threads, but less code. The second one needs more code but it's easier to write down.

Depends on you, how to continue. In both cases you could get some help on how to code the beast.

Best

Stefan

Orangebox
Beiträge: 6
Registriert: 14 Feb 2022, 23:36

Re: Help for beginer in robo pro

Beitrag von Orangebox » 16 Feb 2022, 10:19

Thank you for your help. I was thinking maybe there is easier way for doing that. I was asked to investigate robotics sets for our club to decide which set to buy. We have kids in club from ages 8 to 20. And for presentation i was given same problem for all p.atforms to see all solutions to get best decision. Lego does not have lights. Parallax boe bot with basic programing have best documentation and didactic materials but needs to have electrical knowlage so it is not for youngest same apply to arduino. Fischertechnik is great set but didactical material provided are worst. There is no explanations why? It is easy for basic level one but when you got to variables and yellow lines you have no explanation how to do that.
Correct me if i am wrong please.

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Help for beginer in robo pro

Beitrag von vleeuwen » 16 Feb 2022, 11:02

Nice topic to exchange ideas about the didactics behind program design and program development.
If you understand the basics behind didactic concepts then it should be clear that such material depends on the backgrounds of the target group. It is therefore quite difficult to develop generic didactic material.
Didactically speaking, the concept of "work flow" and "data flow", given its simplicity, is quite easy to explain to young people. You don't even need a computer.

RoboPro's technical documentation is quite good.
Learning to understand a concept is different from learning tricks.
A teacher/instructor with sufficient insight and knowledge will have little problem with this concept.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Help for beginer in robo pro

Beitrag von MasterOfGizmo » 16 Feb 2022, 15:18

Orangebox hat geschrieben:
16 Feb 2022, 10:19
Lego does not have lights.
Which controller did you test?

The powered up led lights work with the spike controller. And there's also a small 3x3 color led matrix for the spike which you can switch to any color and e.g. use as a colored traffic light.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Orangebox
Beiträge: 6
Registriert: 14 Feb 2022, 23:36

Re: Help for beginer in robo pro

Beitrag von Orangebox » 16 Feb 2022, 19:07

I have tested:
Parallax boebot (basic stamp wich is programmed via BASIC and parallax arduino and microbit) with parallax set you get book with all step by step materials and you got the teory behind working models and electronic wich is great but parallax use breadboard connections wich is not so great for younger kids.
Lego mindstorms - have great game like tutorial wich is interesting for kids but does not have led lights and it is more oriented in mobile robotics (vechicless)
mbot - programmed with scratch but it is limmited in building models (you got basic models that you can assembly with chassis) didactical material are more oriented on programming not so much in mechanics and electronics
Several arduino based robots like EMORO
Fischertechnik i got TXT explorer set with additional led lights light sensors magnets and temp sensors. You can build whatever you imagine but there is lack of programing didactical materials you got example programs but with no explanation for some solutions you got step by ste what elemnts to use in program and some solution when you got to yellow lines in robopro are realy clumsy but you have no explanatio why you need to use some blocks in programing you need to follow tuttorial like parrot and dont ask why...
Maybe with new TXT 4.0 and robopro coding will be better since our kids are familiar with microbit. Next week i will receive microbit starter set from fischertechnik to try that too.

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Help for beginer in robo pro

Beitrag von vleeuwen » 18 Feb 2022, 08:54

As an experienced software engineering teacher, this comparison comes across as somewhat funny.
A 4G programming language (RoboPro) is compared with an imperative programming language.
Hardware is confused with programming languages.

What do you really want to teach children?
What exactly are the learning objectives?
Which knowledge and which skills?
What is the student's starting level?
What will the learning curves be?
What theoretical and practical components are needed to achieve those learning objectives?

You should actually make a good substantive comparison between the different program development environments and also see to what extent they provide support for learning good programming skills.
A microcontroller with actuators and sensors only adds a practical component to programming education.
This only concerns the reading and writing of data to ports.
Learning how to program embedded devices is a separate field and requires additional knowledge of the physical limitations of such devices.
There are also measurement and control aspects that must be taken into account. Just think of what "semi real time behaviour" means for example.

How the student handles the syntax and semantics of programming is not taught.
You could ask yourself: to what extent does the program development environment provide a good amount of support in achieving the stated learning objectives.

RoboPro's "help" documentation is pretty good. But you will first have to teach a student to deal with such documentation. Have you understood the essence and simplicity of workflow programming? Because that is necessary for a comparison with imperative programming (textually or via blocks).

What is the difference between, for example: the interpreter language Python and C#, C++. And compare that again with, for example, the declarative languages ​​such as SQL and F#?
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Help for beginer in robo pro

Beitrag von MasterOfGizmo » 18 Feb 2022, 13:06

To me his comparison makes sense. He used all kits and verified for himself how easy it was to get started. If the robo pro help did not work for him then it also won't work for the kids.

BTW. Here are the LEDs for the current lego controllers. The LED matrix:
https://education.lego.com/de-de/produc ... trix/45608

And the single white LEDs:
https://www.lego.com/de-de/product/light-88005
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Antworten