COSA
An Object-Oriented Platform for Arduino Programming
Rotary.cpp File Reference
#include "Rotary.hh"
Include dependency graph for Rotary.cpp:

Go to the source code of this file.

Macros

#define DIR_NONE   0x0
 
#define DIR_CW   0x10
 
#define DIR_CCW   0x20
 
#define R_START   0x0
 
#define R_CCW_BEGIN   0x1
 
#define R_CW_BEGIN   0x2
 
#define R_START_M   0x3
 
#define R_CW_BEGIN_M   0x4
 
#define R_CCW_BEGIN_M   0x5
 
#define R_CW_FINAL   0x1
 
#define R_CW_BEGIN   0x2
 
#define R_CW_NEXT   0x3
 
#define R_CCW_BEGIN   0x4
 
#define R_CCW_FINAL   0x5
 
#define R_CCW_NEXT   0x6
 

Variables

const uint8_t Rotary::Encoder::half_cycle_table[6][4] __PROGMEM
 

Detailed Description

Version
1.0

License

Copyright (C) 2011, Ben Buxton (Rotary encoder state machine) Copyright (C) 2013-2015, Mikael Patel (Cosa port and extension)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

This file is part of the Arduino Che Cosa project.

Definition in file Rotary.cpp.

Macro Definition Documentation

#define DIR_CCW   0x20

Definition at line 94 of file Rotary.cpp.

#define DIR_CW   0x10

Definition at line 92 of file Rotary.cpp.

#define DIR_NONE   0x0

Definition at line 90 of file Rotary.cpp.

#define R_CCW_BEGIN   0x1

Definition at line 156 of file Rotary.cpp.

#define R_CCW_BEGIN   0x4

Definition at line 156 of file Rotary.cpp.

#define R_CCW_BEGIN_M   0x5

Definition at line 102 of file Rotary.cpp.

#define R_CCW_FINAL   0x5

Definition at line 157 of file Rotary.cpp.

#define R_CCW_NEXT   0x6

Definition at line 158 of file Rotary.cpp.

#define R_CW_BEGIN   0x2

Definition at line 154 of file Rotary.cpp.

#define R_CW_BEGIN   0x2

Definition at line 154 of file Rotary.cpp.

#define R_CW_BEGIN_M   0x4

Definition at line 101 of file Rotary.cpp.

#define R_CW_FINAL   0x1

Definition at line 153 of file Rotary.cpp.

#define R_CW_NEXT   0x3

Definition at line 155 of file Rotary.cpp.

#define R_START   0x0

Definition at line 97 of file Rotary.cpp.

#define R_START_M   0x3

Definition at line 100 of file Rotary.cpp.

Variable Documentation

const uint8_t Rotary::Encoder::full_cycle_table [7][4] __PROGMEM
Initial value:
= {
}
#define R_START_M
Definition: Rotary.cpp:100
#define DIR_CW
Definition: Rotary.cpp:92
#define R_CCW_BEGIN_M
Definition: Rotary.cpp:102
#define DIR_CCW
Definition: Rotary.cpp:94
#define R_START
Definition: Rotary.cpp:97
#define R_CCW_BEGIN
Definition: Rotary.cpp:156
#define R_CW_BEGIN
Definition: Rotary.cpp:154
#define R_CW_BEGIN_M
Definition: Rotary.cpp:101

Half-cycle state table (emits a code at 00 and 11)

dot_inline_dotgraph_1.png

Full-cycle state table (emits a code at 00 only)

dot_inline_dotgraph_2.png

Definition at line 136 of file Rotary.cpp.