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: Servo_fullrange mbed
Fork of Kola_Servo_nowe by
Revision 1:da4c204737bf, committed 2016-06-14
- Comitter:
- yruiewyrui3
- Date:
- Tue Jun 14 13:32:33 2016 +0000
- Parent:
- 0:2e73d45d090e
- Child:
- 2:325a730cd438
- Commit message:
- .
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 14 12:32:39 2016 +0000
+++ b/main.cpp Tue Jun 14 13:32:33 2016 +0000
@@ -140,7 +140,7 @@
cam_poziom.position(po);
cam_pion.position(pi);
}
-void fill_buffer()
+void fill_buffer(int i)
{
bufor[i] = stm.getc();
if(i==0){
@@ -165,6 +165,7 @@
int main(){
int i = 0;
+ cleanBuffer(bufor);
stm.baud(115200);
while(true){
if(t.read_ms()>200){ //jesli przez ponad 200ms nie ma nowej ramki, zatrzymujemy robota
@@ -172,9 +173,8 @@
eng_right.move(0);
}
//if((bufor[9] == NULL)&&(stm.readable()))
- if(bufor[9] == NULL){
- fill_buffer();
- continue;
+ while (bufor[9] == NULL){
+ fill_buffer(i);
}
if(isCorrectPacket(bufor)){
t.stop();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jun 14 13:32:33 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file
