File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 3
3
* the ArduinoUnit library to your Arduino/libraries/ directory.
4
4
* available here: https://github.com/mmurdoch/arduinounit (2.0 or greater.)
5
5
*/
6
+
7
+ // * Due to arduino issue, Wire and Servo libraries need to be included. Should be fixed in later versions
6
8
#include < Wire.h>
7
9
#include < Servo.h>
10
+ // */
8
11
#include < ArduinoUnit.h>
9
12
#include " Firmata.h"
10
13
#include " utility/EncoderFirmata.h"
@@ -21,6 +24,8 @@ void setup()
21
24
Serial.begin (57600 ); // must match port configuration
22
25
}
23
26
27
+
28
+
24
29
test (attachEncoder)
25
30
{
26
31
EncoderFirmata encoder;
@@ -33,6 +38,17 @@ test(attachEncoder)
33
38
assertTrue (encoder.isEncoderAttached (encoderNum));
34
39
}
35
40
41
+ test (requiredMemoryPerEncoder)
42
+ {
43
+ assertTestPass (attachEncoder);
44
+ EncoderFirmata encoder;
45
+ byte encoderNum = 0 , pin1 = 2 , pin2 = 3 ;
46
+ int initialMemory = freeMemory ();
47
+ encoder.attachEncoder (encoderNum, pin1, pin2);
48
+
49
+ assertTrue ((initialMemory - freeMemory ()) < 1 );
50
+ }
51
+
36
52
test (handleAttachEncoderMessage)
37
53
{
38
54
assertTestPass (attachEncoder);
Original file line number Diff line number Diff line change 5
5
* Download version 2.0 or greater.
6
6
*/
7
7
8
+ // * Due to arduino issue, Wire and Servo libraries need to be included. Should be fixed in later versions
9
+ #include < Wire.h>
10
+ #include < Servo.h>
11
+ // */
8
12
#include < ArduinoUnit.h>
9
13
#include < Firmata.h>
10
14
You can’t perform that action at this time.
0 commit comments