haloooo.. lae semua kali ini saya akan berbagi contoh program arduino pada pengontrolan modul GSM gateway pada arduino , semoga artikel ini bisa bermanfaat bagi lae-lae semua hahahh
copas aja lae , gratis kok lekkkk
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <GSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmaAaccess;
GSM_SMS sms;
LiquidCrystal_I2C lcd(0x3F,16,2); //set the LCD address to 0x27 for a 20 char and 4 display
#define level_1 A3
#define level_2 A2
#define level_3 A1
#define level_4 A0
#define buzzer 12
#define selenoid 6
#define pompa 7
int i,j;
char isi_SMS[13],c;
char senderNumber[20];
char pompa_on[13]="#POMPA ON@";
int level1, level2, level3, level4;
boolean flag_sms,flag_level1,flag_level4,pump_on:
void setup(){
lcd.backlight(); lcd.int();
Serial.begin(9600);
//put your setup code here, to run once:
pinMode (level_1,INPUT);digitalWrite(level_1,HIGH);
pinMode (level_2,INPUT);digitalWrite(Level_2,HIGH);
pinMode (level_3,INPUT);digitalWrite(level_3,HIGH);
pinMode (level_4,INPUT);digitalWrite(level_4,HIGH);
pinMode (buzzer,OUTPUT);
pinMode (pompa,OUTPUT);digitalWrite(pompa,HIGH);
pinMode (selenoid,OUTPUT);digitalWrite(selenoid,HIGH);
lcd.setCursor(0,0); lcd.print("READING GSMS ");
boolean notConnected=true;
while (notConnected)
{if(gsmAccess.begin(PINNUMBER) == GSM_READY)
notConnected=false;
else
{lcd.setCursor(0,0); lcd.print("GSM Not REARY ");
Serial.println("GSM Not connected";
delay(1000);
}
}
dan ini hasil ujinya lek :
0 Komentar untuk "Contoh Program Mengontrol GSM pada Arduino"