Poddak search karala balanna net eke danata mama gawa ekak nam na.net eke athi basic project
bump
pinMode(14, OUTPUT);
thanxGood book with code samples.
Arduino Cookbook, 2nd Edition
http://it-ebooks.info/book/1982/
Read the CHAPTER 7 - Visual Output.
// A variable to set a delay time between each LED
int delayTime = 10;
// A variable to store which LED we are currently working on
int currentLED = 4;
// A variable to store the direction of travel
int dir = 1;
// A variable to store the last time we changed something
long timeChanged = 0;
// An array to hold the value for each LED pin
byte ledPin[] = {4, 5,6,7, 8, 9, 10, 11, 12, 13};
void setup() {
// Set all pins for OUTPUT
for (int i=0; i<10; i++) {
pinMode(ledPin, OUTPUT);
}
// Record the time once the setup has completed
timeChanged = millis();
}
void loop() {
// Check whether it has been long enough
if ((millis() - timeChanged) > delayTime) {
//turn off all of the LEDs
for (int i=0; i<10; i++) {
digitalWrite(ledPin, LOW);
}
// Light the current LED
digitalWrite(ledPin[currentLED], HIGH);
// Increase the direction value (up or down)
currentLED = currentLED + dir;
// If we are at the end of a row, change direction
if (currentLED == 9) {
dir = -1;
}
if (currentLED == 0) {
dir = 1;
}
// store the current time as the time we last changed LEDs
timeChanged = millis();
}
}
meka knight rider LED system eka umbata uda highlight karapuwaata one ewa deela hada ganin. naethnam digi pin 4-13 ta resister ekka led hi karala mekama hadapan.
thanxmethana thiyenne eka pin ekakta,
int led = 13;
//anith pin tikath methana declare karapan machn
int led1 = 12;
int led2 = 11;
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
// ewa methna output lesa dipan
pinMode(led2, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
// methana nam blink wenna dila thiyenne
methana uba kamathi widhakata dipan
blink wenna oni naththam digitalWrite(led, LOW); kiyana eka ain karala dapn machn
}
mokakda wenna one kiyapan
meka mama knight rider widiyata liyapu code ekak LED 11 kata
void setup()
{
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
for (int i=1; i<=11; i++)
{
digitalWrite(i, HIGH);
delay(100);
digitalWrite(i, LOW);
}
for (int i=10; i>=0; i--)
{
digitalWrite(i, HIGH);
delay(100);
digitalWrite(i, LOW);
}
}