r tist
DESCRIPTION
TRANSCRIPT
R-TISTROBOBOTICS CLUB OF NIT JALANDHAR
DIN 3
Q-:Write a program to blink rgb led when bit
11 ,12 and 13 count one time in forward path one
time in reverse path………………..
Program int timer = 100; int ledPins[] = { 11, 12, 13, 6, 5, 3 }; int pinCount = 6; void setup() { int thisPin; for (int thisPin = 0;
thisPin < pinCount; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
} }
void loop() { for (int thisPin = 0; thisPin <
pinCount; thisPin++) { digitalWrite(ledPins[thisPin],
HIGH); delay(timer); digitalWrite(ledPins[thisPin], LOW);
} for (int thisPin = pinCount - 1; thisPin
>= 0; thisPin--) { digitalWrite(ledPins[thisPin],
HIGH); delay(timer); digitalWrite(ledPins[thisPin],
LOW); } }
CONCEPT OF LM 35 LM 35 IS USE TO MEASURE TO
TEMPERATURE OF SYSTEM.
Write a program to measure the temperature
of classroom using lm35 and show it on serial
port……………………
Program of lm35 void setup() { Serial.begin(9600); }
void loop() { int sensorValue =
analogRead(A0);
Serial.println(sensorValue, DEC);
}
SEVEN SEGMENT DISPLAY
Q-:Write a program to show counting of 0-9 on
seven segment
// Arduino pin: 2,3,4,5,6,7,8 byte seven_seg_digits[10][7] =
{ { 1,1,1,1,1,1,0 }, // = 0 { 0,1,1,0,0,0,0 }, // = 1 { 1,1,0,1,1,0,1 }, // = 2 { 1,1,1,1,0,0,1 }, // = 3 { 0,1,1,0,0,1,1 }, // = 4 { 1,0,1,1,0,1,1 }, // = 5 { 1,0,1,1,1,1,1 }, // = 6 { 1,1,1,0,0,0,0 }, // = 7 { 1,1,1,1,1,1,1 }, // = 8 { 1,1,1,0,0,1,1 } // = 9 };
void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); writeDot(0); // start with the
"dot" off }
void writeDot(byte dot) { digitalWrite(9, dot); }
Void sevenSegWrite(byte digit) {
byte pin = 2; for (byte segCount = 0;
segCount < 7; ++segCount) {
digitalWrite(pin, seven_seg_digits[digit][segCount]);
++pin; } }
void loop() { for (byte count = 10;
count > 0; --count) { delay(1000);
sevenSegWrite(count - 1);
} delay(4000); }
Q-:Write a program to - Illumination of RGB LED’s with Temperature
variation using LM35………………..
program int sec1=3; int sec2=5; int sec3=6; int temp=A0; int sem; int sa; void setup() { pinMode(3, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); }
void loop() { sa =
analogRead(temp); { analogWrite(3,sa); analogWrite(5,sa); analogWrite(6,sa); } }
Any question…………….