Tranfering float via SPI beween two arduinos

That's what you intended to do. What you actually did was:

  1. master sets slave select (SS) Low--> this allows communication with the slave

Slave has command set to 0.

  1. call function transferAndWait ('a') --> sends 'a' receives garbage (whatever was in the slave SPDR)

Slave receives 'a'. Because command is 0, sets command to 'a', puts 0 in SPDR.

  1. call function transferAndWait ('b') --> sends 'b' receives 0 from SPDR and stores it in data.b[0] on master

Slave receives 'b'. Because command is 'a', puts data.b[0] in SPDR.

  1. call function transferAndWait ('c') --> sends 'c' receives 'b[0]' from SPDR and stores it in data.b[1] on master

Slave receives 'c'. Because command is 'a', puts data.b[0] in SPDR.

  1. call function transferAndWait ('d') --> sends 'c' receives 'b[0]' from SPDR and stores it in data.b[2] on master

Slave receives 'd'. Because command is 'a', puts data.b[0] in SPDR.

  1. call function transferAndWait (0) --> sends 0 receives 'b[0]' from SPDR and stores it in data.b[3] on master

Slave receives 0. Because command is 'a', puts data.b[0] in SPDR.

  1. master sets slave select High --> this ends communication with the slave

  2. print results stored in data.f along with each byte of data.b[4]