Hi guys,
time ago i built a Rover (4 wheel, Arduino powered) for my B4A android app:
https://play.google.com/store/apps/details?id=com.rfo.IRaceradvanced
the full tutorial for the Rover is here:
http://www.instructables.com/id/Arduino-4WD-rover-bluetooth-controlled-by-Android-/
The sketch was written for the Arduino IDE and now ported to B4R.
The B4R code and the original sketch are attached with some images while working on
Use the B4R serial connector to communicate with the Rover, check the B4R code for supported commands (mostly used to change the bluetooth module parameters)
The bluetooth module used is the (very basic and cheap) HC-06 but the code should work with the HC-05 too, maybe it needs only some little changes.
Side note:
the original sketch (ino) uses 543 bytes of ram (26%) and 8084 bytes of flash (25%)
the B4R code uses 764 bytes of ram (37%) and 16558 bytes of flash (51%)
Both codes works fine when uploaded to the Rover
Obviously the codes uses different approach and develop is faster on B4R and the porting was very easy
The B4R event-oriented code simplify things .
time ago i built a Rover (4 wheel, Arduino powered) for my B4A android app:
https://play.google.com/store/apps/details?id=com.rfo.IRaceradvanced
the full tutorial for the Rover is here:
http://www.instructables.com/id/Arduino-4WD-rover-bluetooth-controlled-by-Android-/
The sketch was written for the Arduino IDE and now ported to B4R.
The B4R code and the original sketch are attached with some images while working on
Use the B4R serial connector to communicate with the Rover, check the B4R code for supported commands (mostly used to change the bluetooth module parameters)
The bluetooth module used is the (very basic and cheap) HC-06 but the code should work with the HC-05 too, maybe it needs only some little changes.
Side note:
the original sketch (ino) uses 543 bytes of ram (26%) and 8084 bytes of flash (25%)
the B4R code uses 764 bytes of ram (37%) and 16558 bytes of flash (51%)
Both codes works fine when uploaded to the Rover
Obviously the codes uses different approach and develop is faster on B4R and the porting was very easy
The B4R event-oriented code simplify things .
Attachments
-
arduino_b4r.png231.8 KB · Views: 1,688
-
Screenshot_2017-01-21-18-12-05.png161.2 KB · Views: 641
-
Screenshot_2017-01-21-18-12-30.png393.7 KB · Views: 677
-
Screenshot_2017-01-21-18-11-21.png103.1 KB · Views: 632
-
ArduinoRover.zip4.6 KB · Views: 517
-
ArduinoRover_V2_11_original.zip4.8 KB · Views: 570
-
work2.png332.3 KB · Views: 620
-
work1.png374.9 KB · Views: 605