I need to get two dynamic numbers with Arduino.
Import Serial Arduino= Serial.Serial ('COM5', 9600) While (1== 1): if (arduino.inwaiting () > 0): MyData= Arduino.ReadLine () Print (MyData)
If you just read the data from the port, they do not differ from each other. Is it possible in some way to get them separately? I need it to move the object through Pygame.
Def Dvijup (Self, Al): self.keystate= pygame.key.get_pressed () if self.acm > = 10: self.acm== KeyState [pygame.k_up] Self.speedx= -5 if self.acm < = 10: self.acm== Keystate [pygame.k_down] Self.speedx= 5. self.Rect.y += Self.Speedx
So that from one rangefinder to get some numbers on ACM. And from the other on BCM.