![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Ngetes
main.cpp@1:2759fc78aa04, 2018-08-31 (annotated)
- Committer:
- hisyamfs
- Date:
- Fri Aug 31 10:45:30 2018 +0000
- Revision:
- 1:2759fc78aa04
- Parent:
- 0:23b97841e8dc
- Child:
- 2:f07401343541
Bisa;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hisyamfs | 0:23b97841e8dc | 1 | #include "mbed.h" |
hisyamfs | 0:23b97841e8dc | 2 | #include "AX12.h" |
hisyamfs | 0:23b97841e8dc | 3 | |
hisyamfs | 0:23b97841e8dc | 4 | int kosong1, kosong2; |
hisyamfs | 0:23b97841e8dc | 5 | Serial pc(USBTX, USBRX); |
hisyamfs | 0:23b97841e8dc | 6 | int deg1 = 0; |
hisyamfs | 0:23b97841e8dc | 7 | int deg2 = deg1+10; |
hisyamfs | 0:23b97841e8dc | 8 | int id1 = 6; |
hisyamfs | 0:23b97841e8dc | 9 | int id2 = 11; |
hisyamfs | 0:23b97841e8dc | 10 | |
hisyamfs | 0:23b97841e8dc | 11 | int main() |
hisyamfs | 0:23b97841e8dc | 12 | { |
hisyamfs | 0:23b97841e8dc | 13 | AX12 servo1(PC_6, PC_7, PC_8, id1, 1000000); // tx, rx, tx_enable, servo ID, baud rate |
hisyamfs | 1:2759fc78aa04 | 14 | // AX12 servo2(PC_6, PC_7, PC_8, id2, 1000000); |
hisyamfs | 1:2759fc78aa04 | 15 | |
hisyamfs | 0:23b97841e8dc | 16 | while (1) |
hisyamfs | 0:23b97841e8dc | 17 | { |
hisyamfs | 1:2759fc78aa04 | 18 | servo1.SetTorqueEnable(0); |
hisyamfs | 1:2759fc78aa04 | 19 | pc.printf("TEst \n"); |
hisyamfs | 1:2759fc78aa04 | 20 | wait(0.5); |
hisyamfs | 0:23b97841e8dc | 21 | } |
hisyamfs | 0:23b97841e8dc | 22 | } |