Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello,
I want to make a SPI connection between two mbeds. The slave mbed has a value in its program, for exemple : int value = 15. I want to recuperate this value with the other slave, the master.
I have tried this :
On the slave mbed :
#include "mbed.h" SPISlave B(p5, p6, p7, p8); // mosi, miso, sclk, ssel int value; int main() { value = 15; }On the master slave :
#include "mbed.h" SPI A(p5,p6,p7); DigitalOut L1(p8); Serial pc(USBTX, USBRX); int main() { A.format(8,0); A.frequency (1000000); L1=0; int value_recup = A.write(0x00); pc.printf("value_recup = %d\n", value_recup); L1=1; }And on teraterm I have this message : "value_recup = 255". It's not the good value.
Can you help me ?