You are on page 1of 4

Blink led

void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);

// wait for a second

digitalWrite(13, LOW);
delay(1000);

// turn the LED on (HIGH is the voltage level)

// turn the LED off by making the voltage LOW

// wait for a second

Switch led
const int buttonPin = 2;
const int ledPin = 13;

// the number of the pushbutton pin


// the number of the LED pin

// variables will change:


int buttonState = 0;

// variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.


// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

LCD DISPLAY
*/

// include the library code:


#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);

// Print a message to the LCD.


lcd.print("hello, world!");
}

void loop() {
// Turn off the display:
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
}

Call gsm
const int ledpin = 13;
void setup()
{
pinMode(8,INPUT);
pinMode(ledpin,OUTPUT);
Serial.begin(9600);
delay(30000);
}
void callsomeone()
{

Serial.println("AT");
delay(900);

Serial.println("ATD9994442064;");
delay(20000);
Serial.println("ATH");
delay(6000);

}
void loop()
{
callsomeone();
//digitalWrite(ledpin, HIGH);

You might also like