#include <p18cxxx.h>
#include "lcd_4b.h"

// Fonctions d affichage du rapport cyclique

void init_aff (void)
{
	unsigned char str1 [18] = "Rapport cyclique";
	lcd_com(0x80);
	lcd_str (str1);
	lcd_com(0xC0);
	lcd_car(0xE0);
	lcd_com(0xC2);
	lcd_car('=');
	lcd_com(0xC7);
	lcd_car('%');
}

void aff_rap_cyc (unsigned char Rap_cyc)
{
	lcd_com (0xC4);
	lcd_car (' ');
	lcd_car (' ');
	lcd_car (' ');

	if(Rap_cyc==0){
		lcd_com (0xC6);
		lcd_car ('0');
	}else
	if(Rap_cyc==20){
		lcd_com (0xC5);
		lcd_car ('2');
		lcd_car ('0');
	}else
	if(Rap_cyc==40){
		lcd_com (0xC5);
		lcd_car ('4');
		lcd_car ('0');
	}else
	if(Rap_cyc==60){
		lcd_com (0xC5);
		lcd_car ('6');
		lcd_car ('0');
	}else
	if(Rap_cyc==80){
		lcd_com (0xC5);
		lcd_car ('8');
		lcd_car ('0');
	}else
	if(Rap_cyc==100){
		lcd_com (0xC4);
		lcd_car ('1');
		lcd_car ('0');
		lcd_car ('0');
	}
}

