This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ADXl335 with nRF51822 interfacing

Hi, all 

i have using adxl335 sensor interfacing ADC ;i have done code ,i wanted to know is it correct or the way i have developed the code can any one suggest me.

 How can i print those x,y,z value on UART and send via BLE.

Parents Reply Children
  • Please try following example of scanning three analog input pins..

    while (true)
    {
    adc_config();
    nrf_adc_start();
    uint32_t adc = adc_sample;

    nrf_delay_ms(1);  // wait for some time
    adc1_config();
    nrf_adc_start();
    uint32_t adc1 = adc_sample;

    nrf_delay_ms(1);   // wait for some time
    adc2_config();
    nrf_adc_start();
    uint32_t adc2 = adc_sample;

    nrf_delay_ms(1);    // wait for some time
    printf("%d\r\n", adc); // out ADC result
    printf("%d\r\t", adc1); // out ADC result
    printf("%d\r\t", adc2); // out ADC result

    __SEV();
    __WFE();
    __WFE();

    }

Related