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: Sensor/TweLite_Sensors.cpp
- Revision:
- 34:770a6bbb4d63
- Parent:
- 33:d939479e7b13
- Child:
- 35:63ccdae58da4
--- a/Sensor/TweLite_Sensors.cpp Wed Mar 01 08:05:52 2017 +0000 +++ b/Sensor/TweLite_Sensors.cpp Wed Mar 01 14:34:27 2017 +0000 @@ -9,10 +9,11 @@ std::string TweLite_Sensors::str; -TweLite_Sensors::TweLite_Sensors(PinName tx, PinName rx) : twelite(tx,rx,9600){ +TweLite_Sensors::TweLite_Sensors(PinName tx, PinName rx) : twelite(tx,rx){ receivef=0; request=0; size=0; + twelite.baud(9600); twelite.attach(this,&TweLite_Sensors::twelite_rx,Serial::RxIrq); flipper.attach(this,&TweLite_Sensors::flip, 0.25); } @@ -52,7 +53,7 @@ char c=twelite.getc(); if(c==CADENCEHEADER){ receivef=1; - str[size]=CADENCEHEADER;//pushできない size()は0のまま + str[size]=CADENCEHEADER;//pushできない size()は0のまま//両方できるっぽい size++; }else if(c==ULTSONICHEADER){ receivef=1;