Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- sNICKer1103
- Date:
- 2014-05-04
- Revision:
- 4:a091b8f8216d
- Parent:
- 3:da30c350c339
- Child:
- 5:e4ed6c5baf89
File content as of revision 4:a091b8f8216d:
#include "mbed.h"
#include "I2CDriver.h"
#include "SPIDriver.h"
#include "LedCube.h"
#include "rtos.h"
const int FRAMES = 700;
const int SPIFREQ = 10000000; //frequency of SPI interface
const char ADDRESS = 0xA0; //address van I2C interface
LedCube* ledcube = new LedCube();
SPIDriver* spidriver = new SPIDriver(p5, NC, p7, p8, p10, SPIFREQ);
I2CDriver* i2cdriver = new I2CDriver(p28, p27, ADDRESS);
//DigitalOut blank(p9);
void streamThread(void const* args);
void inputThread(void const* args);
int main()
{
spidriver->testPhase(FRAMES);
printf("Initiating stream from following matrices\n\r");
ledcube->printAll();
printf("Streaming...\n\r");
Thread thread1(streamThread);
Thread thread2(inputThread);
while(true){}
}//end main
void streamThread(void const* args)
{
while(true) {
spidriver->sendFrame(ledcube);
}
}
void inputThread(void const* args)
{
while(true) {
i2cdriver->pollForInput(ledcube);
}
}