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.
Diff: Arduino.cpp
- Revision:
- 1:d96590319bcf
- Parent:
- 0:d93ce07131fc
--- a/Arduino.cpp Sat Apr 07 04:11:19 2018 +0000 +++ b/Arduino.cpp Sat Apr 07 07:40:13 2018 +0000 @@ -2,15 +2,15 @@ #include "Arduino.h" -Arduino::Arduino(PinName tx, PinName rx) : _tx(tx), _rx(rx){ +Arduino::Arduino(PinName tx, PinName rx) : _arduino(tx,rx){ _arduino.baud(9600); } -void Arduino::_sendCommand(char com){ - _arduino.clc(); +void Arduino::sendCommand(char com){ + //_arduino.clc(); _arduino.printf("&c", com); } -int Arduino::_recieveData(){ +int Arduino::receiveData(){ char value[100]; int index=0; char ch; @@ -29,22 +29,22 @@ } int Arduino::getLdrY(){ - _sendCommand('y'); - return _recieveData(); + sendCommand('y'); + return this->receiveData(); } int Arduino::getLdrX(){ - _sendCommand('x'); - return _recieveData(); + sendCommand('x'); + return receiveData(); } int Arduino::getColor(){ - _sendCommand('c'); - return _recieveData(); + sendCommand('c'); + return receiveData(); } int Arduino::getOrientation(){ - _sendCommand('a'); - return _recieveData(); + sendCommand('a'); + return receiveData(); }