marwaben
Newbie level 2
i ddidn't find nothing in this web sit plaese help
this is my file but it is not compleate
#include "C:\Users\maroua\Desktop\trame gps\main.h"
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#define LED_R PIN_B4
#define LED_V PIN_B5
//#use rs232(baud=38400,rcv=pin_c7, xmit=pin_c6,parity=n)//gps only needs the rx and gnd pin
int8 ft=1,cnt=0;
char cot[]={"\X22"};
//int i;
int1 mouv=1;
int32 ms;
/******************************************************************************/
#int_ext
void int_rb0()
{
mouv=1;
}
#int_timer2
void isr_timer2(void) {
ms++;
}
//********************************************************************************//
// fonction envoisms vers gps//
//********************************************************************************//
void envoi_sms() {
// if(mouv==1) {
// mouv=0;
if (!input(PIN_A0))
{
ft=1;
if(ft==1&&cnt==0)
{ output_high(LED_R);
output_high(PIN_B5);
printf("at+cmgf=1\r\n"); //mode texte
delay_ms(1000);
printf("AT+CMGS=%s92334936%s\r\n",cot,cot); //selectionner le destinataire
delay_ms(1000);
printf("Il y' a quelq'un dans la Voiture\X1A"); //ecrire les infos dans le msg
delay_ms(2000);
delay_ms(2000);
printf ("at+cgdcont=1\r\n");//pdp contexte
delay_ms(1000);
printf("at+cgatt=1\r\n");//gps active
delay_ms(1000);
printf("at+cgsms=0\r\n");//selection du service sms pour le gps
delay_ms(2000);
cnt=1;
}
}
else cnt=0;
}
//########################################
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
//Setup_Oscillator parameter not selected from Intr Oscillotar Config tab
// TODO: USER CODE!!
while(true) {
envoi_sms();
if(ms > 2000)
{
ms=0;
output_low(LED_R);
output_low(pin_B4);
}
}
}
this is my file but it is not compleate
#include "C:\Users\maroua\Desktop\trame gps\main.h"
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#define LED_R PIN_B4
#define LED_V PIN_B5
//#use rs232(baud=38400,rcv=pin_c7, xmit=pin_c6,parity=n)//gps only needs the rx and gnd pin
int8 ft=1,cnt=0;
char cot[]={"\X22"};
//int i;
int1 mouv=1;
int32 ms;
/******************************************************************************/
#int_ext
void int_rb0()
{
mouv=1;
}
#int_timer2
void isr_timer2(void) {
ms++;
}
//********************************************************************************//
// fonction envoisms vers gps//
//********************************************************************************//
void envoi_sms() {
// if(mouv==1) {
// mouv=0;
if (!input(PIN_A0))
{
ft=1;
if(ft==1&&cnt==0)
{ output_high(LED_R);
output_high(PIN_B5);
printf("at+cmgf=1\r\n"); //mode texte
delay_ms(1000);
printf("AT+CMGS=%s92334936%s\r\n",cot,cot); //selectionner le destinataire
delay_ms(1000);
printf("Il y' a quelq'un dans la Voiture\X1A"); //ecrire les infos dans le msg
delay_ms(2000);
delay_ms(2000);
printf ("at+cgdcont=1\r\n");//pdp contexte
delay_ms(1000);
printf("at+cgatt=1\r\n");//gps active
delay_ms(1000);
printf("at+cgsms=0\r\n");//selection du service sms pour le gps
delay_ms(2000);
cnt=1;
}
}
else cnt=0;
}
//########################################
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(SPI_SS_DISABLED);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
//Setup_Oscillator parameter not selected from Intr Oscillotar Config tab
// TODO: USER CODE!!
while(true) {
envoi_sms();
if(ms > 2000)
{
ms=0;
output_low(LED_R);
output_low(pin_B4);
}
}
}