Boo0ns / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Firmata.processInput() and millis() don't work together #503

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the millis() function and the Firmata.processInput() function in the 
same program.

What is the expected output? What do you see instead?
The expected output is for the serial monitor to see the value of millis() at 
roughly 1000 increments (this is indeed what I see when I comment out the line 
"Frimata.processInput()" (see pasted serial output below). Instead, I see 
correct output until the millis() begins to return numbers large enough to 
require more than two bytes. At this point, the numbers that I see become very 
large (again, see the pasted serial output below).

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

Arduino version 22
Windows 7
Arduino Uno

Please provide any additional information below.

-----------------------------------
Code that displays this bug
-----------------------------------

#include        <Firmata.h>

void setup()
{
    Firmata.begin(9600);
}

void loop()
{
    Firmata.processInput();
    Serial.println(millis());
    delay(5000);
}

-----------------------
Serial monitor output
-----------------------

ù3310
4317
5321
6326
7330
8335
9339
10344
11350
12355
13361
14366
15372
16377
17383
18388
19394
20400
21405
22411
23416
24422
25427
26433
27439
28444
29450
30455
31462
32467
33473
34479
35484
36490
37495
38501
39506
40512
41518
42523
43529
44534
45540
46545
47551
48557
49562
50568
51573
52579
53585
54591
55597
56602
57608
58613
59647
65516
16712666
4294903755
4294904766
4294905776
4294906788
4294907799
4294908810
4294909821

------------------------------------------------------------
Serial monitor output with the following line commented out:
    Firmata.processInput();
------------------------------------------------------------
ù3310
4317
5321
6326
7330
8335
9339
10344
11350
12355
13361
14366
15372
16377
17383
18388
19394
20400
21405
22411
23416
24422
25427
26433
27439
28444
29450
30455
31461
32466
33472
34478
35483
36489
37495
38501
39506
40512
41518
42523
43529
44534
45540
46545
47551
48557
49562
50568
51573
52579
53584
54590
55596
56601
57607
58612
59618
60623
61629
62635
63640
64647
65652
66658
67663
68669
69675
70680
71686
72691
73697
74702
75708
76713
77719
78725
79730
80736
81741
82747
83752
84758
85764
86769
87775
88780
89787
90792
91798
92804
93809
94815
95820
96826
97831
98837
99843
100848
101855
102861
103868
104875
105882
106889
107895
108902

Original issue reported on code.google.com by pkaif...@gmail.com on 10 Mar 2011 at 4:53