problem mit ROBOpro

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Benutzeravatar
han
Beiträge: 14
Registriert: 01 Nov 2010, 01:16
Wohnort: Beets, Nederland
Kontaktdaten:

Re: problem mit ROBOpro

Beitrag von han » 25 Nov 2010, 16:12

Hello ft-jan,

Your program may work well unless you press two switches at the same time. Then the motors will receive contradictory commands from different threads. The same will happen if a switch is not well connected.

But in general it is not good programming practice to use threads in this way. Threads are meant for processes that should run really independent of each other. It are in fact different programs running at the same time. Here the threads are dependent of each other: one thread can say to the motor "turn left" and another thread can say at the same time to the same motor "turn right". No wonder the motor gets nervous.

I think something like this is better (and simplier):
Bild

If you press here two switches at the same time, the program will only see the first one. In the same program you can add the other part (rauf/runter), no extra thread needed.

Regards, Han.

Ski3989
Beiträge: 19
Registriert: 17 Feb 2014, 18:32

Re: problem mit ROBOpro

Beitrag von Ski3989 » 02 Jul 2016, 17:01

Hallo,

hängt dieses Problem immer von den Prozessen ab?
Niklas

Antworten