Professional Documents
Culture Documents
Arduino Library
Folder headerFileLibrary.
Berisi keyword yg
keywords.txt digunakan , akan
berwarna (foreground)
beda
Folder examples Berisi contoh code
Library folder Struktur Folder library
Folder headerFileLibrary
sourceCodeLibrary.cpp
Berisi defini fungsi
Folder src
Berisi keyword yg
digunakan , akan
keywords.txt
berwarna (foreground)
beda
Folder examples Berisi contoh code
Library folder Struktur Folder library
Library folder
Morse.h
Morse.cpp
Morse.h Morse.cpp
#include “Arduino.h"
#ifndef Morse_h #include "Morse.h"
#define Morse_h
Morse::Morse(int pin)
#include “Arduino.h“ {
pinMode(pin, OUTPUT);
_pin = pin;
class Morse }
{
void Morse::dot()
public: {
Morse(int pin); digitalWrite(_pin, HIGH);
delay(250);
void dot(); digitalWrite(_pin, LOW);
void dash(); delay(250);
}
Morse morse(13);
// buat object class library void setup()
namaClass namaobjek {
}
void loop()
//Gunakan fungsi objeck yg sdh dibuat {
namaObject.fungsi morse.dot();
morse.dash();
delay(3000);
}
#ifndef Morse_h
#define Morse_h
#endif
#endif
#include "Arduino.h"
Header file Arduino.h yg berisi fungsi2 dasar arduino antara lain :
pinMode();
digitalWrite();
digitalRead();
analogRead();
analogReference();
analogWrite();
millis();
micros(;
delay();
delayMicroseconds();
#include<LiquidCrystal.h> #include<LiquidCrystal.h>