Joey Dionne
/
Code_APP3_R
pre commentaire
Fork of Code_APP3_R by
Sensors/IO_p15.cpp@10:7aac6ba67e1d, 2017-02-14 (annotated)
- Committer:
- JoeyDionne
- Date:
- Tue Feb 14 17:34:46 2017 +0000
- Revision:
- 10:7aac6ba67e1d
- Parent:
- 9:dc81d8ee4a97
app3 pre commentaire
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ericbisson | 9:dc81d8ee4a97 | 1 | #include "IO_p15.h" |
ericbisson | 9:dc81d8ee4a97 | 2 | |
ericbisson | 9:dc81d8ee4a97 | 3 | DigitalIn btn(p15); |
ericbisson | 9:dc81d8ee4a97 | 4 | bool bLastState = false; |
ericbisson | 9:dc81d8ee4a97 | 5 | |
ericbisson | 9:dc81d8ee4a97 | 6 | //--------------------------------------------------------------// |
ericbisson | 9:dc81d8ee4a97 | 7 | // Fonction pour l'envoie de données pour le bouton |
ericbisson | 9:dc81d8ee4a97 | 8 | // Testé et fonctionnel |
ericbisson | 9:dc81d8ee4a97 | 9 | //--------------------------------------------------------------// |
ericbisson | 9:dc81d8ee4a97 | 10 | void func_button(CArray* DATA_TO_SEND) |
ericbisson | 9:dc81d8ee4a97 | 11 | { |
ericbisson | 9:dc81d8ee4a97 | 12 | if (!bLastState == btn) |
ericbisson | 9:dc81d8ee4a97 | 13 | { |
ericbisson | 9:dc81d8ee4a97 | 14 | DATA_TO_SEND->_ptr = new char[1]; |
ericbisson | 9:dc81d8ee4a97 | 15 | DATA_TO_SEND->_ptr[0] = btn; |
ericbisson | 9:dc81d8ee4a97 | 16 | DATA_TO_SEND->size = 1; |
ericbisson | 9:dc81d8ee4a97 | 17 | } |
ericbisson | 9:dc81d8ee4a97 | 18 | bLastState = btn; |
ericbisson | 9:dc81d8ee4a97 | 19 | } |
ericbisson | 9:dc81d8ee4a97 | 20 | //--------------------------------------------------------------// |