UART array transmission test code. (Receive)

Dependencies:   mbed

main.cpp

Committer:
el15tcd
Date:
2018-05-25
Revision:
2:6f9b37d8b6aa
Parent:
1:adb918553885

File content as of revision 2:6f9b37d8b6aa:

#include "mbed.h"

Serial device2(p9,p10);  //tx,rx
BusOut myleds(LED4, LED3, LED2, LED1);

DigitalOut scope(p21);

char buffer2[4];
int temp2;

char matrix2[144][96];
char sensorData[36][48];
char buttonTest[2][2];

int led1;
int led2;
int led3;
int led4;

int main()
{

    myleds = 0;

    device2.baud(115200);

    while(1) {
        
        led2 = !led2;
        temp2 = device2.getc();
        if (temp2 == 1) {
            for (int j=0; j<36; j++) {
                for (int i=0; i<48; i++) {

                    sensorData[i][j] = device2.getc();

                }
            }
            scope = !scope;
            led1 = !led1;
            temp2 = 0;
        }
    }
}