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: mbed
Fork of RCControlOOP by
Diff: WirelessMousr.cpp
- Revision:
- 5:dda15798ba1f
- Parent:
- 3:b3ec75e9163f
- Child:
- 6:29a4a4eba154
--- a/WirelessMousr.cpp Wed Oct 08 19:36:05 2014 +0000 +++ b/WirelessMousr.cpp Thu Oct 09 13:07:37 2014 +0000 @@ -2,8 +2,8 @@ #define INSTRUCTION 0 #define VELOCITY 1 -WirelessMousr::WirelessMousr() : Mousr(), pc(p28, p27) {} -//WirelessMousr::WirelessMousr() : Mousr(), pc(USBTX, USBRX) {} +//WirelessMousr::WirelessMousr() : Mousr(), pc(p28, p27) {} //USE FOR BT +WirelessMousr::WirelessMousr() : Mousr(), pc(USBTX, USBRX) {} //USE FOR USB int WirelessMousr::init() { @@ -27,22 +27,22 @@ if ((oldstate == 'l') || (oldstate == 'r')) { - this->pc.putc('V'); + //this->pc.putc('V'); - numerator = ((int)message - 128); - denominator = (float) 128; + numerator = ((int)message - 50); + denominator = (float) 50; pwmval = ((float) numerator) / denominator; if (oldstate == 'l') { this->lefttire(pwmval); - this->pc.putc('L'); - this->pc.putc('L'); + //this->pc.putc('L'); + //this->pc.putc('L'); } else if (oldstate == 'r') { this->righttire(pwmval); - this->pc.putc('R'); - this->pc.putc('R'); + //this->pc.putc('R'); + //this->pc.putc('R'); } } else