Currently, I am working on registering values on log and receiving data using python3 library.
I tried to update integer data(65 to 90) in order and monitored the received data with Crazyflie PC client.
But the received data wasn't matching with the data I updated.
Here is my code and result.
Code: Select all
#define DEBUG_MODULE "uartDeck"
#include "debug.h"
#include "deck.h"
#include "deck_core.h"
#include "log.h"
#include "FreeRTOS.h"
#include "stdbool.h"
#include "timers.h"
#include "uart1.h"
#include "console.h"
#include "task.h"
//static xTimerHandle timer;
char cData;
char i=65;
void receiveData(void *param)
{
//DEBUG_PRINT("Running Uart:\n");
while(1)
{
cData=i;
i++;
if(i==90)
i=65;
}
}
static void uartCommInit(DeckInfo *info)
{
uart1Init(9600);
xTaskCreate(receiveData, "commUart",configMINIMAL_STACK_SIZE, NULL, /*priority*/1, NULL);
DEBUG_PRINT("Inited uartComm deck.\n");
}
static const DeckDriver uartCommDriver = {
.name = "commUart",
.usedGpio = 0,
.init = uartCommInit,
};
DECK_DRIVER(uartCommDriver);
LOG_GROUP_START(myUartData)
LOG_ADD(LOG_UINT8, character, &cData)
LOG_GROUP_STOP(myUartData)
Is there any problem in my code? or Is there any limit on the rate of updating data?
Thank you.