contact: ozhantr@hotmail.com
2013-05-04 17:05:46 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino pull-up button
#define BUTTON_PIN 2

void setup()
{
  ...
  pinMode(BUTTON_PIN, INPUT);
  digitalWrite(BUTTON_PIN, HIGH); // connect internal pull-up
  ...
}

void loop()
{
  ...
}
2012-12-08 20:21:07 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino PPM Links
2012-12-04 16:33:38 | Yazıyı Oku | | ozhantr@hotmail.com
createChar()
#include
#include
int i = 0;

byte doldur[8] = { B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111 };
  
LiquidCrystal_I2C lcd(0x20,20,4);

void setup()
{
  lcd.init();                    
  lcd.backlight();
  lcd.createChar(0, doldur);
  lcd.setCursor(0, 0);
}

void loop()
{
//lcd.write(0);
//lcd.print((char)0);
delay(500);
}
2011-10-03 10:29:17 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino LCD Symbol
#define S_DOWN         0x00
#define S_UP           0x01
#define S_BOX          0xff
2011-10-03 09:33:59 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino Foto Links
2009-09-29 13:53:30 | Yazıyı Oku | | ozhantr@hotmail.com
Photo Trigger with Arduino for Nikon D70
int pinIRLED = 12;
const int laserSensor = 0;
int val = 0;
int maxVal = 0;
int control = 0;

const int redLed = 6;
const int greenLed = 7;

void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(greenLed, OUTPUT);
  pinMode(pinIRLED, OUTPUT); // set the pin as an output
  Serial.begin(9600);
}

// sets the pulse of the IR signal.
void pulseON(int pulseTime) {
  unsigned long endPulse = micros() + pulseTime; // create the microseconds to pulse for
  while( micros() < endPulse) {
    digitalWrite(pinIRLED, HIGH); // turn IR on
    delayMicroseconds(13); // half the clock cycle for 38Khz (26.32×10-6s) - e.g. the 'on' part of our wave
    digitalWrite(pinIRLED, LOW); // turn IR off
    delayMicroseconds(13);   // delay for the other half of the cycle to generate wave/ oscillation
  }

}

void pulseOFF(unsigned long startDelay) {
  unsigned long endDelay = micros() + startDelay; // create the microseconds to delay for
  while(micros() < endDelay);
}

void takePicture() {
  for (int i=0; i < 2; i++) {
    pulseON(2000); // pulse for 2000 uS (Microseconds)
    pulseOFF(27830); // turn pulse off for 27830 us
    pulseON(390); // and so on
    pulseOFF(1580);
    pulseON(410);
    pulseOFF(3580);
    pulseON(400);
    pulseOFF(63200);
  } // loop the signal twice.
}

void loop() {
  digitalWrite(greenLed, HIGH);
  val = analogRead(laserSensor);          // read analog input pin 0
  if(val > maxVal)
  {
    maxVal = val;
    control = maxVal - 6;
  }
  else if(val < control)
  {
    takePicture();                 // take the picture
    Serial.println("Photo");       // prints
    Serial.print(val);      
    Serial.print(" - ");  
    Serial.print(control);      
    Serial.println();
    
    digitalWrite(greenLed, LOW);
    digitalWrite(redLed, HIGH);  
    delay(5000);
    digitalWrite(greenLed, HIGH);
    digitalWrite(redLed, LOW);  
  }
  //Serial.println(val, DEC);       // prints the value read
  //delay(100);  
  //takePicture();
}
2009-09-25 14:13:58 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino with Piezo Speaker
int speakerPin = 9;

void setup() {
  pinMode(speakerPin, OUTPUT);
}

void loop()
{
     sesVer(115);
     sesVer(120);
     sesVer(115);
     sesVer(120);

     delay(5000);    
    
}

void sesVer(int tone)
{
    for(int i=0; i <= 500; i++)
    {
      digitalWrite(speakerPin, HIGH);
      delayMicroseconds(tone);
      digitalWrite(speakerPin, LOW);
      delayMicroseconds(tone);
      //tone += i;
    }

    delay(50);
}
2009-08-16 16:00:31 | Yazıyı Oku | | ozhantr@hotmail.com
Candela Effect
int led = 9;

void setup() {
  pinMode(led, OUTPUT);
}

void loop() {
  randomSeed(millis());
  analogWrite(led, random(0, 255));
  delay(random(0, 100));
}
2009-04-29 21:05:25 | Yazıyı Oku | | ozhantr@hotmail.com
Step Motor Control
2009-04-25 20:03:22 | Yazıyı Oku | | ozhantr@hotmail.com
özlü sözler
2009-03-18 12:51:46 | Yazıyı Oku | | ozhantr@hotmail.com
C# with Arduino (Led On/Off/Pwm Control)
C# ile Arduino için seri port kontrollü güzel bir Pwm uygulaması yazdım kodlar ve programları bilgisayarınaza indirip deneyebilirsiniz, iyi eğlenceler :)

C# Application Download: http://ozhan.org/_dosyalar/icerik/C_Arduino_LedFading.zip




C# with Arduino from OZHAN on Vimeo.

/* bu kodlar Arduino Duemilanove için */
/* codes for Arduino Duemilanove */


int Led = 13;
int PwmLed = 11;
int Csharp;

void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
  pinMode(Led, OUTPUT);
}

void loop() {

  if (Serial.available() > 0) {
    
    Csharp = Serial.read();

    Serial.println(Csharp, DEC);
    
    analogWrite(PwmLed, Csharp);

  }
}
2009-03-16 21:14:02 | Yazıyı Oku | | ozhantr@hotmail.com
Arduino ile Seri İletişim
Arduino ile ilk seri iletişim örneğim :) Hyper Terminal'i açın BaundRate hızını 9600 olarak ayarlayın işte size "Günaydın Dünya" klasiği :)

printIn ile print farkı nedir? printIn gönderilen veri sonunda \n yani satır başına geç komutu gönderiyor. print'te ise \n yok.

void setup() {
  Serial.begin(9600);  
}

void loop() {
  Serial.println("Günaydın Dünya");
  delay(500);
}