Skip to content

Commit

Permalink
successfully call distance api
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanZotti committed Sep 19, 2016
1 parent 1f0a1d2 commit b1650fa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drive_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ def get(self):
self.write("Finished")

class DistanceSenor(tornado.web.RequestHandler):


def get(self):
self.write(calculate_distance)
self.write(str(calculate_distance(ECHO,TRIG)))

class MultipleKeysHandler(tornado.web.RequestHandler):

Expand Down Expand Up @@ -217,7 +215,7 @@ def make_app():
return tornado.web.Application([
(r"/drive",MultipleKeysHandler),(r"/post", PostHandler),
(r"/StoreLogEntries",StoreLogEntriesHandler),
("r/distance",DistanceSenor)
(r"/distance",DistanceSenor)
])

if __name__ == "__main__":
Expand All @@ -226,8 +224,8 @@ def make_app():
motor = Motor(16, 18, 22, 19, 21, 23)

# Range sensor details
TRIG = 2
ECHO = 3
TRIG = 3
ECHO = 5
GPIO.setup(TRIG, GPIO.OUT)
GPIO.setup(ECHO, GPIO.IN)

Expand Down

0 comments on commit b1650fa

Please sign in to comment.