This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDSLCDK6748: expression must have integral type

Part Number: TMDSLCDK6748

Hi Team,

Our customer is trying to write a simple code to generate sinewave and represent it to oscilloscope using TMDSLCDK6748. He is getting the error below while building his project.

""../main.c", line 26: error #31: expression must have integral type"

Below is the code for reference

#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <stdio.h>
#include "aic3106.h"

#define PI 3.14159265358979323846
#define SAMPLING_FREQ 48000
#define BUFFER_SIZE 1024

//int16_t buffer[BUFFER_SIZE];

float buffer[BUFFER_SIZE];

float i;

int main(void) {
// Initialize audio codec
aic3106_init();

// Set sampling rate
aic3106_set_sampling_rate(SAMPLING_FREQ);

// Generate sine wave
for (i = 0; i < BUFFER_SIZE; i++) {
buffer[i] = 32767 * sin(2 * PI * 1000 * i / SAMPLING_FREQ);
}

// Output sine wave
while (1) {
for (i = 0; i < BUFFER_SIZE; i++) {
aic3106_write_buffer(buffer[i]);
}
}

return 0;

Can you please take a look at his code and let us know what is causing the error?

Regards,

Danilo