sub showPosData { control::geti2caddress($i2c); my $robot = shift; my $target = shift; my $dist; $posshow->delete('all'); #Canvas das die Positionen anzeigen soll(te) { foreach (sort keys %$oo) { if ($oo->{$_}{pos}{x} > 0 and $oo->{$_}{pos}{y} > 0) { my $color = 'blue'; $color = 'red' if ($oo->{$_}{mode} eq 'active'); pos::createText($posshow, $oo->{$_}, $_, $color); #erstellt die Texte fürs canvas } else { control::stopmotor(); } } my $targetangle = pos::calcDirection($oo, $currentactive, $currentpassive); my ($x, $y) = pos::createAngle($targetangle); $posshow->createLine($oo->{$robot}{pos}{x}, $oo->{$robot}{pos}{y}, $oo->{$robot}{pos}{x} + $x, $oo->{$robot}{pos}{y} + $y, -fill => 'red', -arrow => 'last'); [ ... ] $posshow->update; #Canvas aktualisieren... geht aber nicht :(((( } }