Fehler beim Buchstaben schreiben korrigiert
This commit is contained in:
parent
b654633332
commit
452bd1486e
1 changed files with 12 additions and 9 deletions
21
iqrobot.py
21
iqrobot.py
|
@ -57,12 +57,15 @@ class IQRobot:
|
||||||
self.drehe(grad)
|
self.drehe(grad)
|
||||||
self.movementMotors.move(radius - stift_versatz)
|
self.movementMotors.move(radius - stift_versatz)
|
||||||
|
|
||||||
|
def fahre_gerade(self, cm):
|
||||||
|
self.movementMotors.move(cm)
|
||||||
|
|
||||||
def buchstabe_zu_segmenten(self, buchstabe):
|
def buchstabe_zu_segmenten(self, buchstabe):
|
||||||
# Segmente um Buchstaben zu schreiben
|
# Segmente um Buchstaben zu schreiben
|
||||||
# 5_
|
# 4_
|
||||||
# 6 |__|4
|
# 5 |__|3
|
||||||
# 1 |7_|3
|
# 0 |6_|2
|
||||||
# 2
|
# 1
|
||||||
#
|
#
|
||||||
buchstabe_zu_segmenten = {"L": [1,1,0,0,0,1,0], "E": [1,1,0,0,1,1,1], "G": [1,1,1,0,1,1,0], "O": [1,1,1,1,1,1,0]}
|
buchstabe_zu_segmenten = {"L": [1,1,0,0,0,1,0], "E": [1,1,0,0,1,1,1], "G": [1,1,1,0,1,1,0], "O": [1,1,1,1,1,1,0]}
|
||||||
return buchstabe_zu_segmenten[buchstabe]
|
return buchstabe_zu_segmenten[buchstabe]
|
||||||
|
@ -75,17 +78,17 @@ class IQRobot:
|
||||||
print("Schreibe " + buchstabe)
|
print("Schreibe " + buchstabe)
|
||||||
segmente = self.buchstabe_zu_segmenten(buchstabe)
|
segmente = self.buchstabe_zu_segmenten(buchstabe)
|
||||||
grad_drehung=-90
|
grad_drehung=-90
|
||||||
self.movementMotors.move(2)
|
self.fahre_gerade(2)
|
||||||
self.drehe(grad_drehung)
|
self.drehe_backstein_robot(-grad_drehung) # drehe rechts
|
||||||
for segment, segment_nummer in enumerate(segmente):
|
for segment, segment_nummer in enumerate(segmente):
|
||||||
print("Segment: " + str(segment) + " , Segment Nummer: " + str(segment_nummer))
|
print("Segment: " + str(segment) + " , Segment Nummer: " + str(segment_nummer))
|
||||||
if segment==1:
|
if segment==1:
|
||||||
self.bewege_stift(-1)
|
self.bewege_stift(-1)
|
||||||
self.movementMotors.move(5)
|
self.fahre_gerade(5)
|
||||||
if segment==1:
|
if segment==1:
|
||||||
self.bewege_stift(1)
|
self.bewege_stift(1)
|
||||||
if (segment_nummer+1) != 3:
|
if segment_nummer != 2 and segment_nummer != 6:
|
||||||
self.drehe_backstein_robot(grad_drehung)
|
self.drehe_backstein_robot(grad_drehung) # drehe links
|
||||||
|
|
||||||
|
|
||||||
def schreibeL(self, schreibe=True, zurueck=False):
|
def schreibeL(self, schreibe=True, zurueck=False):
|
||||||
|
|
Loading…
Reference in a new issue