Other Parts Discussed in Thread: MSP430F5438
Hello,
I'm still new to TI products, so I beg your indulgence for my problems here.
I have an MSP-EXP430F5438 experimenter board, and I've been "playing" with it for a few days now, with the different features like the balance ball, USB-UART features. I've been trying to write a programme enabling the acquisition of the x y and z axis readings from the accelerometer (every 1s for example), and display the 3 values on the lcd screen.
I'm using primarily the halAccelerometerRead function, but it doesn't seem to read anything. Here's more or less my code:
void main (void) {
int accx, accy, accz;
char x_string[10];
char y_string[10];
halAccelerometerInit();
halLcdInit();
halLcdClearScreen();
while(1) {
halAdcStartRead();
halAccelerometerRead(&accX, &accY, &accZ);
sprintf(x_string, "%d", accX);
sprintf(y_string, "%d", accY);
halLcdPrintLine(x_string, 0, 0);
halLcdPrintLine(y_string, 4, 0);
}
}
the thing is that it displays only two 0 on the screen on lines 0 and 4, and nothing changes, even when I shake or tilt the board. The while loop works, as verified by a counter that I implemented later, sprintf and printline works as well. Somehow the ADC refuses to read or transmit the data.
Any idea here where you can help me ? Thanks a zillion...