Sms SIM300使用PIC16f在Mikroc中发送短信
我一直在尝试使用SIM300模块发送短信。虽然模块在尝试使用超级终端时工作正常,但我无法使用PIC发送短信 下面是我尝试过的代码(也包括LCD(LCD工作正常)): 编程:MikroCSms SIM300使用PIC16f在Mikroc中发送短信,sms,gsm,pic,mikroc,Sms,Gsm,Pic,Mikroc,我一直在尝试使用SIM300模块发送短信。虽然模块在尝试使用超级终端时工作正常,但我无法使用PIC发送短信 下面是我尝试过的代码(也包括LCD(LCD工作正常)): 编程:MikroC 控制器:PIC16f877A 模块:SIM300 你应该试试 Uart1写入文本(“AT+CMGF=1\r”) 因为“\r”表示“回车”或“返回”,有时“0x0D”在微控制器中不起作用 我一直在使用它,它对我来说很好。你用超级终端测试了模块吗?你试过用超级终端测试你的照片吗? sbit LCD_RS at RB4
控制器:PIC16f877A
模块:SIM300 你应该试试 Uart1写入文本(“AT+CMGF=1\r”) 因为“\r”表示“回车”或“返回”,有时“0x0D”在微控制器中不起作用
我一直在使用它,它对我来说很好。你用超级终端测试了模块吗?你试过用超级终端测试你的照片吗?
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;
void main(){
//CMCON = 7; //Disable Comparators
Lcd_Init(); // Initialize LCD
UART1_init(9600); //Initiate baud rate to 9600
Delay_ms(500); //Delay
UART1_Write_Text("AT+CMGF=1"); //Write "AT+CMGF=1"
UART1_Write(0x0D); // mean (ENTER)
Delay_ms(500); //Delay
UART1_Write_Text("AT+CMGS="); //Write "AT+CMGS="
UART1_Write(0x22); //Write (")
UART1_Write_Text("9449869619"); //Number SMS send to
UART1_Write(0x22); //Write (")
UART1_Write(0x0D); // mean (ENTER)
Delay_ms(500); //Delay
UART1_Write_Text("WELCOME");
UART1_Write(0x0D); //Words to be sent
UART1_Write(0x1A);
//Write "ctrl+z"
Delay_ms(500); //Delay
Lcd_Out(1,1,"MSG SENT SUCESSFULLY"); // Write text in first row
}