PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
libpropeller
libpropeller
quadrature_encoder
quadrature_encoder.test.h
1
#include "unity.h"
2
#include "libpropeller/quadrature_encoder/quadrature_encoder.h"
3
#include "c++-alloc.h"
4
5
6
const
int
basePin = 9;
7
libpropeller::QuadratureEncoder
* sut;
8
9
class
UnityTests
{
10
public
:
11
12
static
void
setUp(
void
) {
13
sut =
new
libpropeller::QuadratureEncoder
();
14
printf(
"Started in cog: %i"
, sut->Start(9, 2));
15
waitcnt
(
CLKFREQ
/ 10 +
CNT
);
16
}
17
18
static
void
tearDown(
void
) {
19
sut->Stop();
20
delete
sut;
21
sut = NULL;
22
}
23
24
static
void
test_Empty(
void
) {
25
//while(true){
26
printf(
"\nPosition: %i"
, sut->GetReading(1));
27
waitcnt
(
CLKFREQ
/ 10 +
CNT
);
28
//}
29
}
30
31
};
libpropeller::QuadratureEncoder
Definition:
quadrature_encoder.h:31
CLKFREQ
#define CLKFREQ
Returns the current clock frequency.
Definition:
propeller.h:46
waitcnt
#define waitcnt(a)
Wait until system counter reaches a value.
Definition:
propeller.h:176
CNT
#define CNT
The system clock count.
Definition:
propeller1.h:151
UnityTests
Definition:
eeprom.test.h:14
Generated on Fri May 20 2022 16:48:01 for PropWare by
1.8.17