Skip to content

Commit c91ec5c

Browse files
committed
Initial upload
1 parent 874268e commit c91ec5c

File tree

9 files changed

+475
-0
lines changed

9 files changed

+475
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Deneyap Relay Arduino Library
2+
[FOR TURKISH VERSION](docs/README_tr.md) ![trflag](https://github.com/deneyapkart/deneyapkart-arduino-core/blob/master/docs/tr.png)
3+
4+
***** Add photo ****
5+
6+
Arduino library for Deneyap Relay
7+
8+
## :mag_right:Specifications
9+
- `Product ID` **M36**, **mpv1.0**
10+
- `MCU` STM8S003F3
11+
- `I2C address` 0x0C, 0x0D, 0x11, 0x12
12+
13+
| Address | |
14+
| :--- | :--- |
15+
| 0x1A | default address |
16+
| 0x0D | address when ADR1 pad is shorted |
17+
| 0x11 | address when ADR2 pad is shorted |
18+
| 0x12 | address when ADR1 and ADR2 pads are shorted |
19+
20+
## :closed_book:Documentation
21+
Deneyap Relay
22+
23+
How to install a Arduino Library -
24+
25+
## :pushpin:Deneyap Relay
26+
This Arduino library allows you to use Deneyap Relay with I2C peripheral. You can use this library in your projects with any Arduino compatible board with I2C peripheral.
27+
28+
## :globe_with_meridians:Repository Contents
29+
- `/docs ` README_tr.md and product photos
30+
- `/examples ` Examples with .ino extension sketches
31+
- `/src ` Source files (.cpp .h)
32+
- `keywords.txt ` Keywords from this library that will be highlighted in the Arduino IDE
33+
- `library.properties ` General library properties for the Arduino package manager
34+
35+
## Version History
36+
37+
1.0.0 - initial release
38+
39+
## :rocket:Hardware Connections
40+
- Deneyap Relay and Board can be connected with I2C cable
41+
- or 3V3, GND, SDA and SCL pins can be connected with jumper cables
42+
43+
| Relay | Function | Board pins |
44+
| :--- | :--- | :--- |
45+
| 3.3V | Power | 3.3V |
46+
| GND | Ground | GND |
47+
| SDA | I2C Data | SDA pin |
48+
| SCL | I2C Clock | SCL pin |
49+
| SWIM | Debug | no connection |
50+
| RES | Debug | no connection |
51+
| TRIG | TRIG |any GPIO pin|
52+
| RLY | RELAY |any GPIO pin|
53+
54+
## :bookmark_tabs:License Information
55+
Please review the [LICENSE](https://github.com/deneyapkart/deneyap-role-arduino-library/blob/master/LICENSE) file for license information.

docs/README_tr.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Deneyap Röle Arduino Kütüphanesi
2+
3+
***** Fotoğraf eklenecek ****
4+
5+
Deneyap Röle için Arduino kütüphanesidir.
6+
7+
## :mag_right:Özellikler
8+
- `Ürün ID` **M36**, **mpv1.0**
9+
- `MCU` STM8S003F3
10+
- `I2C Adres` 0x0C, 0x0D, 0x11, 0x12
11+
12+
| Adress | |
13+
| :--- | :--- |
14+
| 0x1A | varsayılan adres |
15+
| 0x0D | ADR1 kısa devre yapıldığındaki adres |
16+
| 0x11 | ADR2 kısa devre yapıldığındaki adres |
17+
| 0x12 | ADR1 ve ADR2 kısa devre yapıldığındaki adres |
18+
19+
## :closed_book:Dokümanlar
20+
Deneyap Röle
21+
22+
Arduino Kütüphanesi Nasıl İndirilir
23+
24+
## :pushpin:Deneyap Röle
25+
Bu Arduino kütüphanesi Deneyap Rölenin I2C çevre birimi ile kullanılmasını sağlar. Arduino ile uyumlu, I2C çevre birimine sahip herhangi bir geliştirme kartı ile bu kütüphaneyi projelerinizde kullanabilirsiniz.
26+
27+
## :globe_with_meridians:Repo İçeriği
28+
- `/docs` README_tr.md ve ürün fotoğrafları
29+
- `/examples` .ino uzantılı örnek uygulamalar
30+
- `/src` kütüphane için .cpp ve .h uzantılı dosyalar
31+
- `keywords.txt` Arduino IDE'de vurgulanacak anahtar kelimeler
32+
- `library.properties` Arduino yöneticisi için genel kütüphane özellikleri
33+
34+
## Sürüm Geçmişi
35+
1.0.0 - ilk sürüm
36+
37+
## :rocket:Donanım Bağlantıları
38+
- Deneyap Röle ile kullanılan geliştirme kartı I2C kablosu ile bağlanabilir
39+
- veya jumper kablolar ile 3V3, GND, SDA ve SCL bağlantıları yapılabilir.
40+
41+
|Röle | Fonksiyon| Kart pinleri |
42+
| :--- | :--- | :--- |
43+
|3.3V | Güç | 3.3V |
44+
|GND | Toprak | GND |
45+
|SDA | I2C Data | SDA pini |
46+
|SCL | I2C Clock | SCL pini |
47+
|SWIM | Debug | bağlantı yok |
48+
|RES | Debug | bağlantı yok |
49+
|TRIG | TRIG | herhangi bir GPIO pini|
50+
|RLY | RELAY | herhangi bir GPIO pini|
51+
52+
## :bookmark_tabs:Lisans Bilgisi
53+
Lisans bilgileri için [LICENSE](https://github.com/deneyapkart/deneyap-role-arduino-library/blob/master/LICENSE) dosyasını inceleyin.

examples/Role/Role.ino

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Röle örneği,
3+
*
4+
* Bu örnekte temel konfigürasyon ayarları yapılmaktadır.
5+
* Röle değeri saniyede bir değişmektedir.
6+
*
7+
* Bu algılayıcı I2C haberleşme protokolü ile çalışmaktadır.
8+
*
9+
* Bu örnek Deneyap Röle için oluşturulmuştur
10+
* ------> www.....com <------ //docs
11+
* ------> https://github.com/deneyapkart/deneyap-role-arduino-library <------
12+
*
13+
*/
14+
#include <Deneyap_Role.h> // Deneyap_Role.h kütüphanesi eklenmesi
15+
16+
Relay Role; // Relay için class tanımlanması
17+
18+
void setup(){
19+
Serial.begin(115200);
20+
if(!Role.begin(0x0C)){ // begin(slaveAdress) fonksiyonu ile cihazların haberleşmesi başlatılması
21+
delay(3000);
22+
Serial.println("I2C bağlantısı başarısız "); // I2C bağlantısı başarısız olursa seri monitore yazdırılması
23+
while(1);
24+
}
25+
}
26+
27+
void loop() {
28+
/* RelayDrive(PinDeğer);
29+
PinDeğer: 0 -----> LOW
30+
1 -----> HIGH */
31+
Role.RelayDrive(0);
32+
delay(1000);
33+
Role.RelayDrive(1);
34+
delay(1000);
35+
}

examples/RoleButon/RoleButon.ino

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Röle buton örneği,
3+
*
4+
* Bu örnekte temel konfigürasyon ayarları yapılmaktadır.
5+
* Deneyap geliştirme kartlarındaki dahili butona basıldığında Röle değeri 0 olmaktadır.
6+
*
7+
* Bu algılayıcı I2C haberleşme protokolü ile çalışmaktadır.
8+
*
9+
* Bu örnek Deneyap Röle için oluşturulmuştur
10+
* ------> www.....com <------ //docs
11+
* ------> https://github.com/deneyapkart/deneyap-role-arduino-library <------
12+
*
13+
*/
14+
#include <Deneyap_Role.h> // Deneyap_Role.h kütüphanesi eklenmesi
15+
16+
Relay Role; // Relay için class tanımlanması
17+
18+
void setup() {
19+
Serial.begin(115200);
20+
pinMode(GPKEY, INPUT);
21+
if (!Role.begin(0x0C)) { // begin(slaveAdress) fonksiyonu ile cihazların haberleşmesi başlatılması
22+
delay(3000);
23+
Serial.println("I2C bağlantısı başarısız "); // I2C bağlantısı başarısız olursa seri monitore yazdırılması
24+
while (1);
25+
}
26+
}
27+
28+
void loop() {
29+
if (digitalRead(GPKEY) == 0) {
30+
Role.RelayDrive(0);
31+
}
32+
else {
33+
Role.RelayDrive(1);
34+
}
35+
}

examples/RoleNoI2C/RoleNoI2C.ino

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* I2C olmadan Röle örneği,
3+
*
4+
* Röle değeri saniyede bir değişmektedir.
5+
*
6+
* Bu algılayıcı I2C haberleşme protokolü ile çalışmaktadır.
7+
* Bu örnek I2C haberleşme protokolü kullanılmadan yazılmıştır.
8+
*
9+
* Bu örnek Deneyap Röle için oluşturulmuştur
10+
* ------> www.....com <------ //docs
11+
* ------> https://github.com/deneyapkart/deneyap-role-arduino-library <------
12+
*
13+
*/
14+
#define ROLE D0 // Role kartındaki TRIG pininin D0 pinine baglanmalıdır
15+
16+
void setup(){
17+
pinMode(ROLE,OUTPUT); // Role cıkıs olarak ayarlanmasi
18+
}
19+
20+
void loop() {
21+
digitalWrite(ROLE,HIGH);
22+
delay(1000);
23+
digitalWrite(ROLE,LOW);
24+
delay(1000);
25+
}

keywords.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#######################################
2+
# Syntax Coloring Map For Deneyap_Role
3+
#######################################
4+
5+
#######################################
6+
# Library (KEYWORD1)
7+
#######################################
8+
9+
Deneyap_Role KEYWORD1
10+
11+
#######################################
12+
# Class (KEYWORD1)
13+
#######################################
14+
15+
Relay KEYWORD1
16+
Role KEYWORD1
17+
18+
#######################################
19+
# Methods and Functions (KEYWORD2)
20+
#######################################
21+
begin KEYWORD2
22+
isConnected KEYWORD2
23+
getFwVersion KEYWORD2
24+
setI2Caddress KEYWORD2
25+
RelayDrive KEYWORD2
26+
#######################################
27+
# Constants (LITERAL1)
28+
#######################################
29+
DATA_BUFFER_SIZE LITERAL1
30+
I2C_SLV_ADDR_ALT1 LITERAL1
31+
I2C_SLV_ADDR_ALT2 LITERAL1
32+
I2C_SLV_ADDR_ALT3 LITERAL1

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=Deneyap Role
2+
version=1.0.0
3+
author=RFtek Electronics <[email protected]>
4+
maintainer=RFtek Electronics <[email protected]>
5+
sentence=Library for Deneyap Relay
6+
paragraph=A simple and efficient library to use Deneyap Relay via I2C peripheral.
7+
category=Device Control
8+
url=https://github.com/deneyapkart/deneyap-role-arduino-library
9+
architectures=*

0 commit comments

Comments
 (0)