def update(fn, l2d): # simulate data[from serial within +-5 of last datapoint sonar = ping.distance_Ff() dy = sonar # add new point to deque line.append(line[MAX_X - 1] + dy) # set the l2d to the new line coords # args are ([x-coords],[y-coords]) l2d.set_data(range(-MAX_X / 2, MAX_X / 2), line)
def read_all(): front = ping.distance_Ff() rear = ping.distance_Fb() left = ping.distance_Fl() right = ping.distance_Fr() return front, left, right, rear print(front, left, right, rear)
def read_all(): front=ping.distance_Ff() rear=ping.distance_Fb() left=ping.distance_Fl() right=ping.distance_Fr() return front,left,right,rear print(front,left,right,rear)