Hey everybody,
My lab group and I are building an Arduino line follower with a sonar sensor for a school project and we are having trouble optimizing our code.
Our codes for line following (Source: QTI Line Follower AppKit for the Small Robot - Parallax) and sonar (Source: http://learn.parallax.com/BoeShield/RoamingPingShieldBot) worked well separately, however upon combining them our robot's movements became shaky and it sometimes runs into walls instead of avoiding them.
Any comments will be greatly appreciated.
Below I have attached our combined code as well as our individual sonar code (which works well).
Combined Code.pdf (272 KB)