Skip to main content

Ardiono Projects



follow the links below to get all the arduino projects you need with ready made codes :) :)

cdn.oreillystatic.com/oreilly/booksamplers/9781449360665_sampler.pdf

tutorial.cytron.com.my/wp-content/uploads/2011/08/User-Manual1.pdf

BasicTutorial


1. Pot Controlled LED's

 void setup() {

  Serial.begin(9600);
  pinMode(0,OUTPUT);
  pinMode(1,OUTPUT);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
 
 
}
void loop() {

  int sensorValue = analogRead(A0);

  Serial.println(sensorValue);
  delay(1); 
  if(sensorValue==1023)
  {
    digitalWrite(0,LOW);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
   
  }
  else if( sensorValue == 20)
 
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
    digitalWrite(6,LOW);
    digitalWrite(7,HIGH);
 
  }
  else if( sensorValue == 50)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,HIGH);
  }
 
  else if( sensorValue == 100)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
  }
  else if(sensorValue == 200)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    digitalWrite(6,HIGH);
    digitalWrite(7,LOW);
  }
  else if(sensorValue == 300)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,LOW);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if (sensorValue == 500)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,LOW);
  digitalWrite(5,LOW);
  digitalWrite(6,LOW);
  digitalWrite(7,HIGH);
  }
  else if (sensorValue == 700)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if( sensorValue == 900)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if ( sensorValue == 990 )
  {
    digitalWrite(0,LOW);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,LOW);
  digitalWrite(5,LOW);
  digitalWrite(6,LOW);
  digitalWrite(7,HIGH);
  }
else
{
  digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,HIGH);
  digitalWrite(7,LOW);
}
}

2. Dancing Led's

void setup()
{
  pinMode(0,OUTPUT);
  pinMode(1,OUTPUT);
  pinMode(3,INPUT);
  pinMode(5,INPUT);
}

void loop()
{
  int sw= digitalRead(3);
  int sw1= digitalRead(5);
 
  if (sw == LOW)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,LOW);
  }
  else if (sw1 == LOW)
  {
      digitalWrite(0,LOW);
      digitalWrite(1,HIGH);
  }
  else
  {
    delay(10000);
    digitalWrite(0,HIGH);
    delay(10000);
    digitalWrite(0,LOW);
    delay(10000);
    digitalWrite(1,HIGH);
    delay(10000);
    digitalWrite(1,LOW);
  }
}


3. Digital Voltmeter Arduino way

int sensorValue = 0;


void setup()
{
   pinMode( 0 ,HIGH );
   pinMode( 1 ,HIGH );
   pinMode( 2 ,HIGH );
   pinMode( 3 ,HIGH );
   pinMode( 4 ,HIGH );
   pinMode( 5 ,HIGH );
   pinMode( 6 ,HIGH );
   pinMode( 7 ,HIGH );
   pinMode( 8,LOW );
}

void loop()

   
  int sensorValue=analogRead(A0);
  Serial.println(sensorValue);
 
  if (sensorValue==20)
  {
      delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
}
   
 
4. Arduino Based Shadow Alarm

// SHADOW ALARM USING ARDUINO //


int rlyPin = 12; // Relay Output Pin
int sensPin = 2; // Sensor Input Pin
int ledPin = 8; // Reminder LED Output Pin
int pzSpeaker = 10; //Piezo-speaker Output Pin
int val = 0; // variable for reading the Input Pin status

void setup() {
  pinMode(rlyPin, OUTPUT); // Set Relay as output
  pinMode(sensPin, INPUT); // Set Shadow Sensor as input
  pinMode(ledPin, OUTPUT); // Set LED as output
  pinMode(pzSpeaker, OUTPUT); // Set Piezo-Speaker as output

}

void loop(){
  val = digitalRead(sensPin); // read input value
  if (val == HIGH) { // check if the input is HIGH
    digitalWrite(rlyPin, HIGH); // turn Relay ON

    digitalWrite(ledPin,HIGH); // turn LED ON

    playTone(500, 600);
    delay(100);
    playTone(500, 800);
    delay(100);

  }
  else {
    digitalWrite(rlyPin, LOW); // turn Relay OFF
    playTone(0, 0);
    delay(300);

  }
}
// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
  duration *= 1000;
  int period = (1.0 / freq) * 1000000;
  long elapsed_time = 0;
  while (elapsed_time < duration) {
    digitalWrite(pzSpeaker,HIGH);
    delayMicroseconds(period / 2);
    digitalWrite(pzSpeaker, LOW);
    delayMicroseconds(period / 2);
    elapsed_time += (period);
  }
}



5. Pulse Counter using Arduino


void setup()
{
  pinMode(0,HIGH);
  pinMode(1,HIGH);
  pinMode(2,HIGH);
  pinMode(3,HIGH);
  pinMode(4,HIGH);
  pinMode(5,HIGH);
  pinMode(6,HIGH);
  pinMode(7,HIGH);
  pinMode(8,LOW);
}
void loop()
{
  delay(1000);
  PORTD=0b11000000;
  delay(1000);
  PORTD=0b11111001;
  delay(1000);
  PORTD=0b10100100;
  delay(1000);
  PORTD=0b10110000;
  delay(1000);
  PORTD=0b10011001;
  delay(1000);
  PORTD=0b10010010;
  delay(1000);
  PORTD=0b10000010;
  delay(1000);
  PORTD=0b11111000;
  delay(1000);
  PORTD=0b10000000;
  delay(1000);
  PORTD=0b10011000;
}
 




Comments

Popular posts from this blog

Microsoft BizTalk Server | Interview Questions | Set 1

Hi Folks, Below is list of Some important questions that you may want to go through for a Biztalk developer role opening. Sharing the set 1 now just with questions. Will be sharing more soon. What is BizTalk Server? List down components of Biztalk server Biztalk architecture how is it? Types of schemas Document schema vs Envelope schema How to create envelope schema and its properties What is Property schema , how to create and its basic properties Purpose of using Flat file schema How to create a Flat file schema What do you mean by Canonical Schema What's is a message type Can a schema be without namespace What is min max and group min max property in a schema Explain Block default property Property promotion and types Distinguished field vs Promoted field Is it possible to promote XML record of complex content What is <Any> element in a schema Max length Promoted field and distinguished field What's Auto mapping and Default mapping  Can w

Microsoft BizTalk Server| Interview Questions| Set 2

Hi folks, We are back with set 2 of Biztalk server developer Interview Questions. Let's have a look then. State and explain stages of receive and send pipeline. Difference Between XML receive pipeline and passThru pipeline. State minimum components required in a pipeline. State maximum components used in a pipeline. Which property is required using Flat file dissambler and what happens if it is not set. What are the base types of pipeline components. What Interfaces are used for developing a general custom component pipeline. What Interfaces are used for implementing a dissambler custom pipeline component. How to execute a pipeline in an Orchestration. How to set properties of an adaptor dynamically in an Orchestration. What is message box and its purpose in Biztalk server. Types of subscription in Biztalk. Is it possible to have more than one port with same name. In which state can a send port do not subscribe to a message. Why multiple receive locations can

Microsoft C# - Basics

What is C#? We'll Take this definition from Wiki: Basic Points we should cover up: We would be learning following points in this Post: Writing and Reading from Console Variables, Data Types and Conversions Operators Conditions Passing Values to methods Handling Nullables Arrays, String, Struct and Enums Let's Code: The below Program will help you understand the basics of the above points listed. Go through each region separately and get to know the syntax of C#. We Believe, it's always better to Code and Learn than Read and Learn! If you want theoretical help related the basics, please visit here: C# Basics   Hope this helps to get you to start off with C# Coding! We would be adding more to this soon! And don't forget to visit  Joodle  to compile your codes online. Thanks! 😀