Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
769803f
updated readme to add new Firmata client libraries
soundanalogous Nov 18, 2013
ecc1b87
remove duplicate word
nicolaspanel Feb 10, 2014
d8f9a75
add interrupt pins, see http://arduino.cc/en/Reference/attachInterrup…
nicolaspanel Feb 10, 2014
58c0518
create EncoderFirmata header file
nicolaspanel Feb 10, 2014
a40eb12
add private method to report all encoders positions
nicolaspanel Feb 10, 2014
3bcec4a
improve documentation
nicolaspanel Feb 10, 2014
3dc34c1
fix syntax issues
nicolaspanel Feb 10, 2014
ccfe8af
add EncoderFirmata implementation file
nicolaspanel Feb 10, 2014
084b667
implement EncoderFirmata
nicolaspanel Feb 10, 2014
b2b5f62
update IS_PIN_INTERRPUT macros, according to http://www.pjrc.com/teen…
nicolaspanel Feb 10, 2014
3a6aacf
update ConfigurableFirmata to manage Encoders
nicolaspanel Feb 10, 2014
c1fe131
rename encoder utilities folder
nicolaspanel Feb 10, 2014
5ce5007
fix synthax errors and and encoder unit tests
Feb 10, 2014
b27db4c
fix remaining bugs and improve testing coverage
Feb 10, 2014
e3977a1
move function to public to improve tests
nicolaspanel Feb 11, 2014
09f240f
improve tests and check for memory leaks
nicolaspanel Feb 11, 2014
bc5e578
add example.ion file for encoders, including protocol proposal
nicolaspanel Feb 11, 2014
5361118
improve documentation
nicolaspanel Feb 11, 2014
4b7b718
Merge branch 'encoders'
nicolaspanel Feb 11, 2014
8a803dc
improve testing and documentation
Feb 11, 2014
113cbd0
add reference to wire and servo to avoid compilation issue
Feb 11, 2014
72aec53
ConfigurableFirmata.ino compiling. Size : 30kbytes
Feb 11, 2014
26e95e3
Automatic reporting report one encoder at the time (best performences)
nicolaspanel Feb 14, 2014
0b2e630
fix naming issue
nicolaspanel Feb 14, 2014
6861d19
improve full report test
nicolaspanel Feb 14, 2014
be9f18e
Merge branch 'develop'
nicolaspanel Feb 14, 2014
dc237a2
there is discussion on the Arduino dev list about resolving this prob…
nicolaspanel Feb 14, 2014
3d7d8b9
Errors and warnings are commented to avoid out-of-sram error.
nicolaspanel Feb 14, 2014
12624a1
AVR gcc doen't implement a true C++ delete so use free instead
nicolaspanel Feb 14, 2014
415a002
Manage ENCODER pin mode
nicolaspanel Feb 14, 2014
4a29597
determine how much memory each instance
nicolaspanel Feb 14, 2014
fdffde9
rename test
nicolaspanel Feb 14, 2014
35aad7d
fix
nicolaspanel Feb 14, 2014
c8dfb81
update tests
nicolaspanel Feb 14, 2014
7e42f61
tests improvement
nicolaspanel Feb 14, 2014
8fa3f0f
change ENCODER to 11 (0x0B)
nicolaspanel Feb 14, 2014
e63bc82
update total pin modes number
nicolaspanel Feb 15, 2014
d1e7eb5
Use sysex responses instead of MIDI
nicolaspanel Feb 16, 2014
f643b34
fix remaining bugs
nicolaspanel Feb 16, 2014
9037100
Report positions only when at least 1 encoder is attached
nicolaspanel Feb 16, 2014
6730517
fix remaining bugs
nicolaspanel Feb 16, 2014
9a7d6ff
fix remaining bugs
nicolaspanel Feb 16, 2014
ff0a55f
Report encoder position after initialization (Firmata convention, eve…
nicolaspanel Feb 16, 2014
47fc4e6
Move ENCODER_DATA instruction to Firmata.h
nicolaspanel Feb 17, 2014
de3052d
use FakeStream#reset instead of FakeStream#flush to cleanup the stream
Feb 17, 2014
cd1f295
Merge pull request #119 from nicolaspanel/master
ntruchsess Feb 20, 2014
8d5f462
implement reporting for changed positions only
ntruchsess Feb 28, 2014
3d7ec6c
memory optimize reportPositions(), adjust test_encoder.ino to match n…
ntruchsess Feb 28, 2014
355bdf1
Merge pull request #120 from ntruchsess/encoder_report_changedonly
ntruchsess Feb 28, 2014
de0d009
remove makefiles from examples
soundanalogous Mar 9, 2014
07c2fa9
added intel galileo to boards.h
soundanalogous Mar 9, 2014
7a67148
update library properties for new IDE 1.5.6 format
soundanalogous Mar 9, 2014
4d746e8
update version in headers and build script
soundanalogous Mar 9, 2014
2a94af8
update readme
soundanalogous Mar 9, 2014
988d3c2
copy over changes from these commits: 27f7e4276974a6a5c74008490f23ba5…
soundanalogous Mar 9, 2014
572f4b3
remove arduino 1.5.x specific build because original build works for …
soundanalogous Mar 9, 2014
2b6bc1e
add back line to delete temp directory
soundanalogous Mar 9, 2014
b524dfc
missing equal sign in comparison
soundanalogous Mar 9, 2014
9cb7d4f
formatting change
soundanalogous Mar 9, 2014
ef50e73
saving a few bytes
soundanalogous Mar 9, 2014
2764059
Merge pull request #122 from firmata/merge-in-dev
soundanalogous Mar 30, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Manage ENCODER pin mode
  • Loading branch information
nicolaspanel committed Feb 14, 2014
commit 415a0024924dfbc87c36c2b3435d08c1623c5f13
1 change: 1 addition & 0 deletions Firmata.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
#define I2C 0x06 // pin included in I2C setup
#define ONEWIRE 0x07 // pin configured for 1-wire
#define STEPPER 0x08 // pin configured for stepper motor
#define ENCODER 0x09 // pin configured for encoders
#define IGNORE 0x7F // pin configured to be ignored by digitalWrite and capabilityResponse
#define TOTAL_PIN_MODES 10

Expand Down
21 changes: 15 additions & 6 deletions utility/EncoderFirmata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ void EncoderFirmata::attachEncoder(byte encoderNum, byte pinANum, byte pinBNum)
{
//Firmata.sendString("Encoder Warning: For better performences, you should only use Interrput pins.");
}
if (Firmata.getPinMode(pinANum)==IGNORE || Firmata.getPinMode(pinBNum)==IGNORE)
return false;
Firmata.setPinMode(pinANum, ENCODER);
Firmata.setPinMode(pinBNum, ENCODER);
encoders[encoderNum] = new Encoder(pinANum, pinBNum);
}

Expand All @@ -59,18 +63,23 @@ void EncoderFirmata::detachEncoder(byte encoderNum)

boolean EncoderFirmata::handlePinMode(byte pin, int mode)
{
if (IS_PIN_INTERRUPT(pin))
{
// nothing to do, pins states are managed
// in "attach/detachEncoder" methods
return true;
if (mode == ENCODER) {
if (IS_PIN_INTERRUPT(pin))
{
// nothing to do, pins states are managed
// in "attach/detach Encoder" methods
return true;
}
}
return false;
}

void EncoderFirmata::handleCapability(byte pin)
{
// nothing to do
if (IS_PIN_INTERRUPT(pin)) {
Firmata.write(ENCODER);
Firmata.write(28); //28 bits used for absolute position
}
}


Expand Down