Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MCP23017 WattBob_TextLCD mbed
Fork of Balanced Arm by
Revision 17:258067827672, committed 2016-02-03
- Comitter:
- wm70
- Date:
- Wed Feb 03 16:31:02 2016 +0000
- Parent:
- 16:585f8b5abc2c
- Child:
- 18:b79a9a7cf5fb
- Commit message:
- not tested changed data to loaddata
Changed in this revision
| PC_Comms/PC_Comms.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PC_Comms/PC_Comms.cpp Wed Feb 03 16:17:13 2016 +0000
+++ b/PC_Comms/PC_Comms.cpp Wed Feb 03 16:31:02 2016 +0000
@@ -99,21 +99,21 @@
void PC_Comms::PC_WriteLoad(char _servo){
char _returnToPC[4];
- int data;
+ int load_data;
- data = my_AX12.GetLoad();
+ load_data = my_AX12.GetLoad();
_returnToPC[0] = 'S';
_returnToPC[1] = 'D';
_returnToPC[2] = '0';
_returnToPC[3] = _servo;
- if(data >= 1000){
- _PCbus.printf("%s%i",_returnToPC, data);
- }else if(data > 1000 && data >= 100){
- _PCbus.printf("%s0%i", _returnToPC, data);
- }else if(data> 1000 && data >= 10){
- _PCbus.printf("%s00%i", _returnToPC, data);
+ if(load_data >= 1000){
+ _PCbus.printf("%s%i",_returnToPC, load_data);
+ }else if(load_data > 1000 && load_data >= 100){
+ _PCbus.printf("%s0%i", _returnToPC, load_data);
+ }else if(load_data> 1000 && load_data >= 10){
+ _PCbus.printf("%s00%i", _returnToPC, load_data);
}else{
- _PCbus.printf("%s000%i", _returnToPC, data);
+ _PCbus.printf("%s000%i", _returnToPC, load_data);
}
}
\ No newline at end of file
