PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
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
};
UnityTests
Definition:
eeprom.test.h:14
libpropeller::QuadratureEncoder
Definition:
quadrature_encoder.h:31
libpropeller::QuadratureEncoder::Start
bool Start(const int basePin, const int numberOfEncoders)
Definition:
quadrature_encoder.h:43
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12