2_LSA/main/main.c
void display_lsa(line_sensor_array readings,u8g2_t *oled_config)
{
    // clear the screen
    u8g2_ClearBuffer(oled_config);

    // plot the bar of LSA 0
    u8g2_DrawFrame(oled_config, 27,0,10,30);
    u8g2_DrawBox(oled_config, 27,0,10,readings.adc_reading[0]*0.03);

    // plot the bar of LSA 1
    u8g2_DrawFrame(oled_config, 47,0,10,30);
    u8g2_DrawBox(oled_config, 47,0,10,readings.adc_reading[1]*0.03);

    // plot the bar of LSA 2
    u8g2_DrawFrame(oled_config,67,0,10,30);
    u8g2_DrawBox(oled_config,67,0,10,readings.adc_reading[2]*0.03);

    // plot the bar of LSA 3
    u8g2_DrawFrame(oled_config, 87,0,10,30);
    u8g2_DrawBox(oled_config, 87,0,10,readings.adc_reading[3]*0.03);

    // Sends the buffer to the OLED Display
	u8g2_SendBuffer(oled_config);
}
// function to display reading on OLED
function to display reading on OLED
function to display reading on OLED
void display_lsa(line_sensor_array readings,u8g2_t *oled_config)
{
    u8g2_ClearBuffer(oled_config);
    u8g2_DrawFrame(oled_config, 27,0,10,30);
    u8g2_DrawBox(oled_config, 27,0,10,readings.adc_reading[0]*0.03);
    u8g2_DrawFrame(oled_config, 47,0,10,30);
    u8g2_DrawBox(oled_config, 47,0,10,readings.adc_reading[1]*0.03);
    u8g2_DrawFrame(oled_config,67,0,10,30);
    u8g2_DrawBox(oled_config,67,0,10,readings.adc_reading[2]*0.03);
    u8g2_DrawFrame(oled_config, 87,0,10,30);
    u8g2_DrawBox(oled_config, 87,0,10,readings.adc_reading[3]*0.03);
	u8g2_SendBuffer(oled_config);
}
void display_lsa ( line_sensor_array readings , u8g2_t * oled_config ) { u8g2_ClearBuffer ( oled_config ) ; u8g2_DrawFrame ( oled_config , 27 , 0 , 10 , 30 ) ; u8g2_DrawBox ( oled_config , 27 , 0 , 10 , readings . adc_reading [ 0 ] * 0.03 ) ; u8g2_DrawFrame ( oled_config , 47 , 0 , 10 , 30 ) ; u8g2_DrawBox ( oled_config , 47 , 0 , 10 , readings . adc_reading [ 1 ] * 0.03 ) ; u8g2_DrawFrame ( oled_config , 67 , 0 , 10 , 30 ) ; u8g2_DrawBox ( oled_config , 67 , 0 , 10 , readings . adc_reading [ 2 ] * 0.03 ) ; u8g2_DrawFrame ( oled_config , 87 , 0 , 10 , 30 ) ; u8g2_DrawBox ( oled_config , 87 , 0 , 10 , readings . adc_reading [ 3 ] * 0.03 ) ; u8g2_SendBuffer ( oled_config ) ; }
function to display reading on OLED
function to display reading on OLED
// clear the screen // plot the bar of LSA 0 // plot the bar of LSA 1 // plot the bar of LSA 2 // plot the bar of LSA 3 // Sends the buffer to the OLED Display