Tool/software: Code Composer Studio
I originally began by modifying the adc single channel example code to operate with each of the three sensors, then I added code to adjust the sensor readings into a usable format for the item that was detected. I tried to debug this and it seemed that the adc was not correctly configured, but the code compiled without issue. I used the array called adcValueX[i], where X is the adc channel, to increment through and find the highest reading for each sensor. I will include one of the tasks that I used for reading the adc below:
Void taskFxn1(UArg arg0, UArg arg1)
{
uint16_t i;
ADC_Handle adc;
ADC_Params params;
int_fast16_t res;
ADC_Params_init(¶ms);
adc = ADC_open(Board_ADC1, ¶ms);
if (adc == NULL) {
System_abort("Error initializing ADC channel 1\n");
}
else {
System_printf("ADC channel 1 initialized\n");
}
for (i = 0; i < ADC_SAMPLE_COUNT; i++) {
res = ADC_convert(adc, &adcValue1[i]);
if (res == ADC_STATUS_SUCCESS) {
System_printf("ADC channel 1 convert result (%d): 0x%x\n", i,
adcValue1[i]);
}
else {
System_printf("ADC channel 1 convert failed (%d)\n", i);
}
System_flush();
}
ADC_close(adc);
}
Since that didn't output properly I tried using sensor controller studio and I created the proper code, but I ran into compiler issues here and I could not figure out how to implement Bluetooth using the controller studio. I have tried to compile both of these with the BLE stack, but none of them seem to work. I have set up a simple way to generate a csv file but I am unable to transmit this without the peripheral Bluetooth configuration. I have tried to find the base code for Project Zero, but it seems as though it is no longer available even though the flash program for it seems to make the device discover able.
Any help would be greatly appreciated!