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.

simple modification of Example Comms program using ADC10MEM value



Hello,

I am using the CC2530ZDK-ZNP-MINI, and I have been modifying the TI example programs for my application.

What I have is a value from my ADC in the ADC10MEM register, and I want to insert this into the test message that gets sent by the example program to the coordinator.

the example is the Basic Comms - End Device - AFZDO, http://processors.wiki.ti.com/index.php/CC2530ZDK-ZNP-MINI

what I have is a test message like 

unsigned char testMessage[] = {0xE0,0xE1};

and all i want to do is change that test message to the value of the ADC10MEM;

but the problem is when the send data funtion is called; 

afSendData(DEFAULT_ENDPOINT,DEFAULT_ENDPOINT, 0, TEST_CLUSTER, testMessage, 2);

The problem I have is with data types, and I cant change testMessage data type to anything else without diving far into the sub routines and also changing the coordinator code, which I don't think I can do.

I thought the simple option was to as ADC10MEM is hex already and testMessage is a hex array, i could use that.

but what i have done so far is manage to display the lower significant nibble of the ADC10MEM register.

the code i used was; 

testMessage[1] = ADC10MEM;

I know that it is not correct but it is a step in the right direction. so when ADC10MEM = 03FF i get the output of just FF on the coordinator.

is it possible to access each nibble of the ADC10MEM register so i could simply make

testMessage[0] = ADC10MEM(upper nibble);

testMessage[1] = ADC10MEM(lower nibble);