![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ok
Fork of _test_suivi_mur by
main.cpp
- Committer:
- vermaelen
- Date:
- 2017-06-07
- Revision:
- 8:24a3fa0f912a
- Parent:
- 6:5f7df5c74a77
File content as of revision 8:24a3fa0f912a:
#include "mbed.h" #include "fct.h" DigitalOut cs(p13); DigitalIn bp(p14); int main() { char A=0x80; char B=0x00; monI2C.write(ADR_PCF,&A,1); vitG.period(PERIOD); vitD.period(PERIOD); vitG.pulsewidth(PERIOD); vitD.pulsewidth(PERIOD); cs = 1; //initialisation de CS à ‘1’ spi.format(16,0); spi.frequency(1000000); bp.mode(PullUp); while(1) { leds.write(bp.read()+1); //cs=0; monI2C.write(ADR_PCF,&B,1); unsigned int valeur = spi.write(0x00); valeur = (valeur>>1)&0x0FFF; printf("valeur lue = %d\n\r", valeur); //cs=1; monI2C.write(ADR_PCF,&A,1); wait(0.05); } }