/*Configure PB5 as output and set the pin LOW */ DDRB = (1u«PINB5); // Configure PB5 as output PORTB &=~(1u«PINB5); // Set PB5 to LOW state while(1) { sleep_enable(); sleep_cpu(); sleep_disable(); touch_sensors_measure(); if ((p_selfcap_measure_data->measurement_done_touch == 1u)) { p_selfcap_measure_data->measurement_done_touch = 0u; if(GET_SELFCAP_SENSOR_STATE(0)) { PORTB |= (1«PINB5); //LED ON when sensor is touched } else { PORTB &= ~(1«PINB5); //LED OFF } } }