FIGnition FUZE Hardware Reference Manual page 65

Table of Contents

Advertisement

A simple Arduino / FIGnition communication demo follows:
Arduino Slave
#include <SPI.h>
void setup (void)
{
Serial.begin (115200); // debugging
pinMode(MISO, OUTPUT); // MISO
SPCR |= _BV(SPE); // Slave Mode
}
// end of setup
// main loop
void loop (void)
{
if(SPSR&SPIF) { //
print(SPDR);
}
}
// end of loop
The arduino code is written as a standard sketch. Sketches always have a setup function
which performs initializations and a loop function which is executed repeatedly. Here,
setup simply activates the arduino's serial port; sets up the MISO pin to be an output (be-
cause we want it to operate in Slave Out mode) and finally enables slave mode. The ardu-
Fig 9.4
FIGnition Master
vram 600 + const spiPckt
spiPckt 10 + const spiSrc
create spiBuff $2B20 ,
spiSrc , 1 , 0 , 0 ,
: spiDemo
spiBuff spiPckt 10 cmove
$20 $DF $2A >port> drop
begin
key dup emit dup
spiSrc ic! spiPckt >spi
127 = until
;

Advertisement

Table of Contents
loading

Table of Contents