Does anyone have experience using SPI? To get the following to even try to work, I had to set
#define DEVICE_SPISLAVE 1
in device.h
however, I get the following error -
..\Mine\ArduboyHat\Test.cpp|80|error: 'class mbed::SPI' has no member named 'read'|
#include "Pokitto.h"
#include "HWSound.h"
#include "SPISlave.h"
Pokitto::Core game;
void startup(){
game.begin();
game.display.persistence=1;
game.setFrameRate(255); // max out the frame rate so that it doesn't get used
game.display.setInvisibleColor(-1);
//SPI spi(P1_22, P1_21, P1_20); // mosi, miso, sclk
SPISlave device(P1_21, P1_22, P1_20, P1_5); // mosi, miso, sclk, ssel
device.reply(0x00); // Prime SPI with first reply
}
int main(){
startup();
while (game.isRunning()) {
int v = device.read();
if(game.update()){
//print v;
} // update
} // game running
return 1;
}
Am I missing something simple, or is something not set up correctly in Pokittolib somewhere?