'Arduino'에 해당되는 글 103건

  1. 2016.10.04 4-Phase 5-Wire Stepper Motor (28BYJ-48) [D021]
  2. 2016.10.04 TowerPro SG5010 Micro Servo (SG5010) [D032]
  3. 2016.10.04 SG90 Camera Mount [B051]
  4. 2016.10.04 Tower Pro SG90 Micro Servo (SG90) [D018]
  5. 2016.09.30 Helicopter Coreless DC Motor [S143]
  6. 2016.09.30 DC6~12V R030 Biaxial Double Axis DC Motor (R030) [D067]
  7. 2016.09.30 9376 Motor Miniatura (9376) [D019]
  8. 2016.09.30 Micro 130 DC Motor [D071]
  9. 2016.09.28 Sound Output Speaker Module (RB-02S093) [D049]
  10. 2016.09.27 Small Passive buzzer module (KY-006) [D023]
  11. 2016.09.27 Passive Buzzer [D027,D028,D029]
  12. 2016.09.27 Active Buzzer [D026]
  13. 2016.09.26 7 inch TFT LCD Module SSD1963 800x480 (SSD1963) [D042]
  14. 2016.09.26 2.4 Inch TFT Touch LCD Shield (ST7781) [D001]
  15. 2016.09.21 ACS712T Current Sensor Module 20A (ACS712T) [B039]
  16. 2016.09.21 B25 Voltage Sensor DC0~25V [B125]
  17. 2016.09.21 84x84 Nokia 5110 LCD Module (LCD5110) [D055]
  18. 2016.09.21 LCD 4002 Blue (ERM4002SBS-1) [D051]
  19. 2016.09.21 LCD2004 I2C Green (LCD2004A) [D046]
  20. 2016.09.21 LCD2004 I2C ( LCD2004A) [D017]
  21. 2016.09.21 LCD1602 I2C (LCD1602) [D016]
  22. 2016.09.21 LCD1602 (HD44780) [D002]
  23. 2016.09.21 NeoPixel Stick - 8 x WS2812 (5050RGB) [D009]
  24. 2016.09.21 6bits Multicolor Rapid Prototyping LED [D050]
  25. 2016.09.19 Bargraph Segment LED Module (SHB10R) [D024]
  26. 2016.09.18 Magic Cup Light Module (KY-027) [D020]
  27. 2016.09.18 RGB LED Module SMD (KY-009) [D008]
  28. 2016.09.18 RGB LED Module DIP (KY-016) [D007]
  29. 2016.09.18 RGB LED (BL-L515) [D006]
  30. 2016.09.18 7 color flash LED Module (KY-034) [D010]

4-Phase 5-Wire Stepper Motor (28BYJ-48) [D021]



https://www.youtube.com/watch?v=YzQ7ImtW9bA


* GitHub : https://github.com/rdiot/rdiot-d021.git

* Specs

Color: Silver

Diameter: 28mm

Voltage: 5V

No-load pull into the frequency: >600Hz

Phase: 4

No-load pull-out frequency: >1000Hz

Reduction ratio: 1/64

Pull-in torque: >34.3mN.m (120Hz)

Step Angle: 5.625 x 1/64

Self-positioning torque: >34.3mN.m

DCR: 200ohm +/- 7% (25'C)

Temperature: <40K (120Hz)

Insulation resistance: >10Mohm (500V)

Noise: <40dB (120Hz, No load, 10cm)

Dielectric Strength: AC 600V / 1mA / 1s

Insulation Class: A

Cable length: 24cm

Suitable for guide wind deflector, portable air conditioner valve, etc

Dimensions: 1.65 in x 1.22 in x 0.79 in (4.2 cm x 3.1 cm x 2.0 cm)

Weight: 1.20 oz (34 g)


* Contents

28BYJ-48 Stepper Motor and ULN2003 Motor Driver


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Stepper.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

const int stepsPerRevolution = 2048; // 2048:(360 Degree), 1024:(180 degree)


// ULN2003 IN4, IN2, IN3, IN1

Stepper myStepper(stepsPerRevolution,11,9,10,8); 


int val;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  delay(1000);

  

  myStepper.setSpeed(14); 

  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D021:28BYJ-48");

  lcd.setCursor(0,1);

  lcd.print("B002:X113647");


  // Left 1 round

  myStepper.step(stepsPerRevolution);

  val = stepsPerRevolution;

  lcd.setCursor(0,2);

  lcd.print("right=" + (String)val + "  ");

  delay(500);


  // Right 1 round

  myStepper.step(-stepsPerRevolution);

  val = -stepsPerRevolution;

  lcd.setCursor(0,2);

  lcd.print("left=" + (String)val + "   ");

  delay(500);


}

'3) Actuator > Motor' 카테고리의 다른 글

TT Motor Car Gear Motor [S142]  (0) 2016.10.05
Clamp Gripper Bracket Servo Mount [B045]  (0) 2016.10.04
TowerPro SG5010 Micro Servo (SG5010) [D032]  (0) 2016.10.04
SG90 Camera Mount [B051]  (0) 2016.10.04
Tower Pro SG90 Micro Servo (SG90) [D018]  (0) 2016.10.04
Posted by RDIoT
|

TowerPro SG5010 Micro Servo (SG5010) [D032]



https://www.youtube.com/watch?v=xRpws0Ecrfc


* GitHubhttps://github.com/rdiot/rdiot-d032.git


* Specs

owerPro SG5010 Micro Servo.

Small and exquisite appearance, it is convenient to carry.

Coreless motor and double ball bearing.

Less noise, light weight.

Used for model airplane accessories.

Stable performance and shock proof.

Color: Black

Connector wire length: 28.3cm

Operating speed (4.8V no load): 0.14sec/60 degrees

Operating speed (6.0V no load): 0.11sec/60 degrees

Stall torque(4.8V): (8kg/cm) (110oz/in.)

Stall torque(6.0V): (11kg/cm) (156oz/in.)

Temperature range: -30 to 60°

Dead band width: 4usec

Operation Voltage: 3.5-8.4V

Item weight: 55g

Package including:1 * Torque servo

4 * Rubber grommets

4 * Brass eyelets

5 * Screws

5 * Servo horn set


* Contents

- Key Code

#include <Servo.h>

Servo towerprosg5010; 

 

int pos = 0; 

 

void setup()

{

  towerprosg5010.attach(9); 

}

 

void loop()

{

  for(pos = 0; pos < 180; pos += 1)  // 0 to 180 degrees with 1 degree step

  {                                  

    towerprosg5010.write(pos);  

    delay(120);                       // time set 120 ms 

  }

}

Posted by RDIoT
|

SG90 Camera Mount [B051]



https://www.youtube.com/watch?v=gk7Mg69mgq4


* GitHub https://github.com/rdiot/rdiot-b051.git


* Specs

Weight : 0.050kg (0.11lb.)

Size : 13cm x 9cm x 8cm (5.12in x 3.54in x 3.15in)


* Contents

- Connect

Top ----- D12

Bottom ----- D11


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 


LiquidCrystal_I2C lcd(0x27,20,4);

Servo myservo1;

Servo myservo2;


int servoPin_updown = 12;

int servoPin_leftright = 11;


int pos_updown = 0;

int pos_leftright = 0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo1.attach(servoPin_updown); 

  myservo2.attach(servoPin_leftright); 

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B051:SG90 Mount");



  for(pos_leftright = 0; pos_leftright < 180; pos_leftright += 1) 

  { 

    myservo2.write(pos_leftright);

    //lcd.setCursor(0,1);

    //lcd.print("pos0~179=" + (String)pos + "  " );


    delay(10); 

  }


  for(pos_leftright = 180; pos_leftright>=0; pos_leftright-=1)

  { 

    myservo2.write(pos_leftright); 

    //lcd.setCursor(0,2);

    //lcd.print("pos180~1=" + (String)pos + "  " );

    delay(10); 

  } 


  

  for(pos_updown = 80; pos_updown < 180; pos_updown += 1) 

  { 

    myservo1.write(pos_updown);

    //lcd.setCursor(0,1);

    //lcd.print("pos0~179=" + (String)pos + "  " );


    delay(10); 

  }


  for(pos_updown = 180; pos_updown>=80; pos_updown-=1)

  { 

    myservo1.write(pos_updown); 

    //lcd.setCursor(0,2);

    //lcd.print("pos180~1=" + (String)pos + "  " );

    delay(10); 

  } 


}

Posted by RDIoT
|

Tower Pro SG90 Micro Servo (SG90) [D018]



https://www.youtube.com/watch?v=qdUgJtBClZ4


* GitHubhttps://github.com/rdiot/rdiot-d018.git


* Specs

Speed: 0.12 second / 60 degrees rotation

Torque: 1.2-1.4kg @ 4.8V~6V power

Comes with full ranged connectivity accessories and mounting screws

Working temperature: -30 to +60 degrees Celsius

Dead band setting: 7 microseconds


* Contents

- Connect

Brown - GND

Red - 5V

Orange - D12



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 



LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

Servo myservo; 

int servoPin = 12;

int pos = 0; 


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo.attach(servoPin); 

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D018:SG90 Servo");


  for(pos = 0; pos < 180; pos += 1) 

  { 

    myservo.write(pos);

    lcd.setCursor(0,1);

    lcd.print("pos0~179=" + (String)pos + "  " );


    delay(0); // Control Speed by delay time.

  }


  for(pos = 180; pos>=1; pos-=1)

  { 

    myservo.write(pos); 

    lcd.setCursor(0,2);

    lcd.print("pos180~1=" + (String)pos + "  " );

    delay(0); 

  } 

}


Posted by RDIoT
|

Helicopter Coreless DC Motor [S143]



https://www.youtube.com/watch?v=Rl3i2DRYErg


* GitHub https://github.com/rdiot/rdiot-s143.git


* Specs

Voltage: DC 3.7-4.2V

Current: 0.1A

Speed: DC3.7V------39000 RPM; D4.2V-----45000RPM

Motor diameter: 7MM

Motor length: 16MM

Output shaft diameter: 0.8MM

Output shaft length: 4.5MM

Weight: 2g

Propeller length: 45MM

Propeller: Red or Black


* Contents

- Key Code

void setup() {

  pinMode(A0,OUTPUT);

  pinMode(A1,OUTPUT);

}

 

void loop() {

  digitalWrite(A0,HIGH);

  digitalWrite(A1,LOW);

  delay(1000);

  digitalWrite(A0,LOW);

  digitalWrite(A1,HIGH);

  delay(1000);

  digitalWrite(A0,LOW);

  digitalWrite(A1,LOW);

  delay(2000);

}

Posted by RDIoT
|

DC6~12V R030 Biaxial Double Axis DC Motor (R030) [D067]




https://www.youtube.com/watch?v=1jvl2rFBCb4


* GitHub https://github.com/rdiot/rdiot-d067.git


* Specs

Contain: 1pcs R030 motor

Motor Diameter: 15.5 MM

Motor Height: 19 MM (Not include output shaft)

Output shaft Diameter: 1.5 MM

Output shaft length: 13 MM (starting from the front panel)

Voltage: DC6-12V

Speed: 13500RPM(12V)

Weight: 12g

Electric current: 0.1A


* Contents

- Key Code

int motorPin = 9; //D9

void setup() {  

  pinMode(motorPin, OUTPUT);  //PWM

  Serial.begin(9600);

  Serial.println("DC Motor Input Speed 0~255");

  

}

void loop() {

  if(Serial.available())

  {

    int speed = Serial.parseInt();

    Serial.println(speed);

    analogWrite(motorPin,speed);  

  }

}

'3) Actuator > Motor' 카테고리의 다른 글

SG90 Camera Mount [B051]  (0) 2016.10.04
Tower Pro SG90 Micro Servo (SG90) [D018]  (0) 2016.10.04
Helicopter Coreless DC Motor [S143]  (0) 2016.09.30
9376 Motor Miniatura (9376) [D019]  (0) 2016.09.30
Micro 130 DC Motor [D071]  (0) 2016.09.30
Posted by RDIoT
|

9376 Motor Miniatura (9376) [D019]



https://www.youtube.com/watch?v=SpYVBLfMmfI


* GitHubhttps://github.com/rdiot/rdiot-d019.git



* Specs

 
VACIO
MÁXIMA EFICACIA
BLOQUEO
 
V.
R.P.M.
A.
R.P.M.
A.
Kg·cm.
Kg·cm.
A.
 340000.08531900.3417851.35
 685000.170000.54281783
 9123001.11106500.7302204.5
 12165000.125143000.836.52755.2

* Contents

- Connect

Red ----- D7

Black ----- GND

 

Buttton Module

S ----- D2

middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int R = 2;

byte lastButton = HIGH;

byte nowButton = HIGH;

int servo = 7;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

  pinMode(R, INPUT);

  pinMode(servo, OUTPUT);

 

  digitalWrite(R, HIGH);

 

  digitalWrite(servo, LOW);

  

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D019:9376 Motor");

 

  byte nowButton = digitalRead(R);

 

  lcd.setCursor(0,1);

  lcd.print("value="+(String)nowButton);

 

  if (HIGH == lastButton)

  {

    if (LOW == nowButton)

    {

     lcd.setCursor(0,2);

     lcd.print("running motor  ");

     digitalWrite(servo, HIGH);

    }

  }

  else

  {

    if (HIGH == nowButton)

    {

     lcd.setCursor(0,2);

     lcd.print("stopped motor  ");

    digitalWrite(servo, LOW);

 

    }

  }

 

 lastButton = digitalRead(R);

 delay(100);

 

}

Posted by RDIoT
|

Micro 130 DC Motor [D071]



https://www.youtube.com/watch?v=_L1XE6mWqqI


* Specs

Motor Size: 15 *20 MM

Motor Height: 29 MM (bearing set, excluding output shaft)

Output shaft: 2 MM

Output shaft length: 9 MM (starting from the front panel)

Voltage: 3 V-6V

Speed: 5000 RPM (3V); 10000RPM RPM(6V)

Weight: 14g


* Contents

This is a general-purpose motor, a weak magnetic motor, which can be started by solar energy, suitable for small toy car, using 3-6V DC voltage.


- Key Code

int motorPin = 9; //D9

void setup() {  

  pinMode(motorPin, OUTPUT);  //PWM

  Serial.begin(9600);

  Serial.println("DC Motor Input Speed 0~255");

  

}

void loop() {

  if(Serial.available())

  {

    int speed = Serial.parseInt();

    Serial.println(speed);

    analogWrite(motorPin,speed);  

  }

}

Posted by RDIoT
|

Sound Output Speaker Module (RB-02S093) [D049]



https://www.youtube.com/watch?v=lVRLvdxyw9A


* GitHubhttps://github.com/rdiot/rdiot-d049.git


* Specs

1.Product Name: Speaker Module

2.Product Number: RB-02S093

3.Working Voltage: 5v

4.Dimensions: 45mm*25mm

5.Weight: 5g

6.Singal Type: Digital Signals

7.Data Type: Digital Input

8.Pin Definitions:(1)S:Signal (2)-:GND (3)+:VDD


* Contents

- Connect

S ----- D3

+ ----- 5V

- ----- GND

'3) Actuator > Speaker' 카테고리의 다른 글

Mini Dome Tweeter Loud Speaker 500W (TP-005A) [D059]  (0) 2016.09.28
4Ohm 10W Speaker [D073]  (0) 2016.09.28
4Ohm 3W Speaker [D072]  (0) 2016.09.28
Posted by RDIoT
|

Small Passive buzzer module (KY-006) [D023]



https://www.youtube.com/watch?v=ASjVjjn9aGs


* GitHub : https://github.com/rdiot/rdiot-d023.git


* Specs

Buzzer: The Buzzer is an integrated electronic Xiangqi structure, with a DC power supply, widely used in computers, printers, photocopiers, alarms, electronic toys, automotive electronics, telephones, timers, etc. electronic products for sound devices.

Buzzer Category: divided into piezoelectric buzzer and magnetic buzzer

Buzzer circuit pattern symbol: buzzer in the circuit by the letter "H" or "HA" (the old standard with the "FM", "LB", "JD", etc.) respectively.


* Contents

- Connect

S ----- D2

middle ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int S = 2 ;// connect the I/O pin on the buzzer to this


// TONES ==========================================

// Start by defining the relationship between 

// note, period, & frequency. 

#define m_c 3830 // 261 Hz 

#define d 3400 // 294 Hz 

#define e 3038 // 329 Hz 

#define f 2864 // 349 Hz 

#define g 2550 // 392 Hz 

#define a 2272 // 440 Hz 

#define b 2028 // 493 Hz 

#define C 1912 // 523 Hz 

// Define a special note, 'R', to represent a rest

#define R 0

 

// MELODY and TIMING =======================================

// melody[] is an array of notes, accompanied by beats[], 

// which sets each note's relative length (higher #, longer note) 

int melody[] = { g, g, a, a, g, g, e, g, g, e, e, d };

int beats[] = { 16, 16, 16, 16, 8, 8, 32, 16, 16, 8, 8, 16 };

int MAX_COUNT = sizeof(melody) / 2; // Melody length, for looping.

 

// Set overall tempo

long tempo = 40000; //10000

// Set length of pause between notes

int pause = 1000; //1000

// Loop variable to increase Rest length

int rest_count = 100; //<-BLETCHEROUS HACK; See NOTES

 

// Initialize core variables

int tone_ = 0;

int beat = 0;

long duration = 0;

 

// PLAY TONE ==============================================

// Pulse the speaker to play a tone for a particular duration

void playTone() {

 long elapsed_time = 0;

 if (tone_ > 0) { // if this isn't a Rest beat, while the tone has 

 // played less long than 'duration', pulse speaker HIGH and LOW

 while (elapsed_time < duration) {

 

 digitalWrite(S, HIGH);

 delayMicroseconds(tone_ / 2);

 

 // DOWN

 digitalWrite(S, LOW);

 delayMicroseconds(tone_ / 2);

 

 // Keep track of how long we pulsed

 elapsed_time += (tone_);

 }

 }

 else { // Rest beat; loop times delay

 for (int j = 0; j < rest_count; j++) { // See NOTE on rest_count

 delayMicroseconds(duration);

 }

 }

}


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(S, OUTPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D023:KY006PassiveBuz");


  for (int i = 0; i<MAX_COUNT; i++) {

  tone_ = melody[i];

  beat = beats[i];

 

  duration = beat * tempo; // Set up timing

 

  lcd.setCursor(0,1);

  lcd.print("melody[" + (String)i + "] = " + (String)tone_ + "  ");


  lcd.setCursor(0,2);

  lcd.print("beat[" + (String)i + "] = " + (String)beat + "  ");


  lcd.setCursor(0,3);

  lcd.print("durati[" + (String)i + "] = " + (String)duration + " ");



  playTone();

  // A pause between notes...

  delayMicroseconds(pause); 

  }

}

Posted by RDIoT
|

Passive Buzzer [D027,D028,D029]



https://www.youtube.com/watch?v=CLI5iJtxRZ0


* GitHub : https://github.com/rdiot/rdiot-d027.git


* Specs

- Passive Buzzer D12

- Passive Buzzer D22

- Passive Buzzer KPR-G2445 (KPR-G2445)

Rated Voltage 12Vp-p Square Wave

Max.Allowable Voltage 30Vp-p Square Wave

Max.Rated Current 3mA at 4.5KHz/12Vp-p Square Wave

Min.Sound Pressure Level 80dB at 4.5KHz/12Vp-p Square Wave/30cm

Resonant Frequency 4.5 ±0.5KHz

Capacitance at 120Hz 24nF±30%

Operating Temperature -20~+60°C

D(mm) Ø24

H(mm) 4.3

weight 2g


* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

#define NOTE_B0  31

#define NOTE_C1  33

#define NOTE_CS1 35

#define NOTE_D1  37

#define NOTE_DS1 39

#define NOTE_E1  41

#define NOTE_F1  44

#define NOTE_FS1 46

#define NOTE_G1  49

#define NOTE_GS1 52

#define NOTE_A1  55

#define NOTE_AS1 58

#define NOTE_B1  62

#define NOTE_C2  65

#define NOTE_CS2 69

#define NOTE_D2  73

#define NOTE_DS2 78

#define NOTE_E2  82

#define NOTE_F2  87

#define NOTE_FS2 93

#define NOTE_G2  98

#define NOTE_GS2 104

#define NOTE_A2  110

#define NOTE_AS2 117

#define NOTE_B2  123

#define NOTE_C3  131

#define NOTE_CS3 139

#define NOTE_D3  147

#define NOTE_DS3 156

#define NOTE_E3  165

#define NOTE_F3  175

#define NOTE_FS3 185

#define NOTE_G3  196

#define NOTE_GS3 208

#define NOTE_A3  220

#define NOTE_AS3 233

#define NOTE_B3  247

#define NOTE_C4  262

#define NOTE_CS4 277

#define NOTE_D4  294

#define NOTE_DS4 311

#define NOTE_E4  330

#define NOTE_F4  349

#define NOTE_FS4 370

#define NOTE_G4  392

#define NOTE_GS4 415

#define NOTE_A4  440

#define NOTE_AS4 466

#define NOTE_B4  494

#define NOTE_C5  523

#define NOTE_CS5 554

#define NOTE_D5  587

#define NOTE_DS5 622

#define NOTE_E5  659

#define NOTE_F5  698

#define NOTE_FS5 740

#define NOTE_G5  784

#define NOTE_GS5 831

#define NOTE_A5  880

#define NOTE_AS5 932

#define NOTE_B5  988

#define NOTE_C6  1047

#define NOTE_CS6 1109

#define NOTE_D6  1175

#define NOTE_DS6 1245

#define NOTE_E6  1319

#define NOTE_F6  1397

#define NOTE_FS6 1480

#define NOTE_G6  1568

#define NOTE_GS6 1661

#define NOTE_A6  1760

#define NOTE_AS6 1865

#define NOTE_B6  1976

#define NOTE_C7  2093

#define NOTE_CS7 2217

#define NOTE_D7  2349

#define NOTE_DS7 2489

#define NOTE_E7  2637

#define NOTE_F7  2794

#define NOTE_FS7 2960

#define NOTE_G7  3136

#define NOTE_GS7 3322

#define NOTE_A7  3520

#define NOTE_AS7 3729

#define NOTE_B7  3951

#define NOTE_C8  4186

#define NOTE_CS8 4435

#define NOTE_D8  4699

#define NOTE_DS8 4978

 

//* 8-ohm speaker on digital pin 8

// http://arduino.cc/en/Tutorial/Tone

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

// notes in the melody:

int melody[] = {

  NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};

 

// note durations: 4 = quarter note, 8 = eighth note, etc.:

int noteDurations[] = { 4, 8, 8, 4, 4, 4, 4, 4 };

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D027~D029:PassiveBuz");

 

  // iterate over the notes of the melody:

  for (int thisNote = 0; thisNote < 8; thisNote++) {

    // to calculate the note duration, take one second 

    // divided by the note type.

    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.

    int noteDuration = 1000/noteDurations[thisNote];

    tone(8, melody[thisNote],noteDuration);

 

    // to distinguish the notes, set a minimum time between them.

    // the note's duration + 30% seems to work well:

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    // stop the tone playing:

 

    lcd.setCursor(0,1);

    lcd.print("[" + (String)thisNote + "] M="+(String)melody[thisNote]+" D="+(String)noteDuration );

    noTone(8);

  } 

}

Posted by RDIoT
|

Active Buzzer [D026]



https://www.youtube.com/watch?v=JzI7O5Gpwgw


* GitHubhttps://github.com/rdiot/rdiot-d026.git


* Specs

5v Magnetic Continuous Tone Active Buzzer. Listing is for 2 buzzers.


* Contents

- Connect

+ ----- 5V

- ----- GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int BUZZER = 8;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(BUZZER,OUTPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("D026 Active Buzzer");


  digitalWrite(BUZZER,HIGH);

  lcd.setCursor(0,1);

  lcd.print("buzzer HIGH");

  delay(1000);


  digitalWrite(BUZZER,LOW);

  lcd.setCursor(0,1);

  lcd.print("buzzer LOW ");

  delay(1000);

}

Posted by RDIoT
|

7 inch TFT LCD Module SSD1963 800x480 (SSD1963) [D042]



https://www.youtube.com/watch?v=fMkpTKbwMIo


* GitHubhttps://github.com/rdiot/rdiot-d042.git


* Specs

This 7.0" TFT LCD Module can be can be easy controlled by MCU such as 51,AVR,STM32,PIC,MSP430,DSP,ARM, and ARM .It can be used in any embedded systems which require display high quality colorful image. The Module used

SSD1963  LCD controller with 7 inch LCD module with touchscreen. This LCD has a superior display quality and super wide viewing angle, please see the sample pictures, they are taken directly from the LCD display.


7.0" TFT LCD Module, Resolution 800x480, SSD1963  Controller

LCD Type: TFT Transmissive Normal White 

Interface: 16bit parallel bus interface 

PCB Color: Blue 

On board 400mA DC-DC Boost regulator to provide power supply to LCD backlight 

LCD-specificed intialization code is provided, so that you can save time to optimize power control register and gamma curves for best display performance. We have test the provided code, it gives the best display performanace 

Module dimension: 186mmx106mmx23mm(including pin header extrusion) 

Active Area: 154mmx86mm 

Pixel pitch: 0.179mmx0.179mm 

Standard 2x20 2.54mm pin header for connection to MCU/development board 

Module weight: 410grams 


* Contents

Arduino Mega + TFT LCD Mega Shield v2.2 

Define the Model Name

UTFT myGLCD(TFT01_70,38,39,40,41);


- Library UTFT : http://www.rinkydinkelectronics.com/library.php?id=51


- Key Code : Ref Code

// UTFT_Demo_800x480 

// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved

// web: http://www.RinkyDinkElectronics.com/

//

// This program is a demo of how to use most of the functions

// of the library with a supported display modules.

//

// This demo was made for modules with a screen resolution 

// of 800x480 pixels.

//

// This program requires the UTFT library.

//

 

#include <UTFT.h>

 

// Declare which fonts we will be using

extern uint8_t SmallFont[];

 

// Set the pins to the correct ones for your development shield

// ------------------------------------------------------------

// Arduino Uno / 2009:

// -------------------

// Standard Arduino Uno/2009 shield            : <display model>,A5,A4,A3,A2

// DisplayModule Arduino Uno TFT shield        : <display model>,A5,A4,A3,A2

//

// Arduino Mega:

// -------------------

// Standard Arduino Mega/Due shield            : <display model>,38,39,40,41

// CTE TFT LCD/SD Shield for Arduino Mega      : <display model>,38,39,40,41

//

// Remember to change the model parameter to suit your display module!

UTFT myGLCD(TFT01_70,38,39,40,41);

 

void setup()

{

  randomSeed(analogRead(0));

  

// Setup the LCD

  myGLCD.InitLCD();

  myGLCD.setFont(SmallFont);

}

 

void loop()

{

  int buf[798];

  int x, x2;

  int y, y2;

  int r;

 

// Clear the screen and draw the frame

  myGLCD.clrScr();

 

  myGLCD.setColor(255, 0, 0);

  myGLCD.fillRect(0, 0, 799, 13);

  myGLCD.setColor(64, 64, 64);

  myGLCD.fillRect(0, 466, 799, 479);

  myGLCD.setColor(255, 255, 255);

  myGLCD.setBackColor(255, 0, 0);

  myGLCD.print("* 7 inch LCD *", CENTER, 1);

  myGLCD.setBackColor(64, 64, 64);

  myGLCD.setColor(255,255,0);

  myGLCD.print("<RDKIM>", CENTER, 467);

 

  myGLCD.setColor(0, 0, 255);

  myGLCD.drawRect(0, 14, 799, 465);

 

// Draw crosshairs

  myGLCD.setColor(0, 0, 255);

  myGLCD.setBackColor(0, 0, 0);

  myGLCD.drawLine(399, 15, 399, 464);

  myGLCD.drawLine(1, 239, 798, 239);

  for (int i=9; i<790; i+=10)

    myGLCD.drawLine(i, 237, i, 242);

  for (int i=19; i<470; i+=10)

    myGLCD.drawLine(397, i, 402, i);

 

// Draw sin-, cos- and tan-lines  

  myGLCD.setColor(0,255,255);

  myGLCD.print("Sin", 5, 15);

  for (int i=1; i<798; i++)

  {

    myGLCD.drawPixel(i,239+(sin(((i*1.13)*3.14)/180)*200));

  }

  

  myGLCD.setColor(255,0,0);

  myGLCD.print("Cos", 5, 27);

  for (int i=1; i<798; i++)

  {

    myGLCD.drawPixel(i,239+(cos(((i*1.13)*3.14)/180)*200));

  }

 

  myGLCD.setColor(255,255,0);

  myGLCD.print("Tan", 5, 39);

  for (int i=1; i<798; i++)

  {

    myGLCD.drawPixel(i,239+(tan(((i*0.9)*3.14)/180)));

  }

 

  delay(2000);

 

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

  myGLCD.setColor(0, 0, 255);

  myGLCD.setBackColor(0, 0, 0);

  myGLCD.drawLine(399, 15, 399, 464);

  myGLCD.drawLine(1, 239, 798, 239);

 

// Draw a moving sinewave

  x=1;

  for (int i=1; i<(798*20); i++) 

  {

    x++;

    if (x==799)

      x=1;

    if (i>799)

    {

      if ((x==399)(buf[x-1]==239))

        myGLCD.setColor(0,0,255);

      else

        myGLCD.setColor(0,0,0);

      myGLCD.drawPixel(x,buf[x-1]);

    }

    myGLCD.setColor(0,255,255);

    y=239+(sin(((i*1.65)*3.14)/180)*(200-(i / 100)));

    myGLCD.drawPixel(x,y);

    buf[x-1]=y;

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random filled rectangles

  for (int i=0; i<50; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=2+random(746);

    y=16+random(397);

    x2=x+50;

    y2=y+50;

    myGLCD.fillRect(x, y, x2, y2);

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random filled, rounded rectangles

  for (int i=0; i<50; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=2+random(746);

    y=16+random(397);

    x2=x+50;

    y2=y+50;

    myGLCD.fillRoundRect(x, y, x2, y2);

  }

  

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random filled circles

  for (int i=0; i<50; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=27+random(746);

    y=41+random(397);

    myGLCD.fillCircle(x, y, 25);

  }

  

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some lines in a pattern

  myGLCD.setColor (255,0,0);

  for (int i=15; i<463; i+=5)

  {

    myGLCD.drawLine(1, i, (i*1.66)-10, 463);

  }

  myGLCD.setColor (255,0,0);

  for (int i=463; i>15; i-=5)

  {

    myGLCD.drawLine(798, i, (i*1.66)+30, 15);

  }

  myGLCD.setColor (0,255,255);

  for (int i=463; i>15; i-=5)

  {

    myGLCD.drawLine(1, i, 770-(i*1.66), 15);

  }

  myGLCD.setColor (0,255,255);

  for (int i=15; i<463; i+=5)

  {

    myGLCD.drawLine(798, i, 810-(i*1.66), 463);

  }

  

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random circles

  for (int i=0; i<250; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=32+random(736);

    y=45+random(386);

    r=random(30);

    myGLCD.drawCircle(x, y, r);

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random rectangles

  for (int i=0; i<250; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=2+random(796);

    y=16+random(447);

    x2=2+random(796);

    y2=16+random(447);

    myGLCD.drawRect(x, y, x2, y2);

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

// Draw some random rounded rectangles

  for (int i=0; i<250; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=2+random(796);

    y=16+random(447);

    x2=2+random(796);

    y2=16+random(447);

    myGLCD.drawRoundRect(x, y, x2, y2);

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

  for (int i=0; i<250; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    x=2+random(796);

    y=16+random(447);

    x2=2+random(796);

    y2=16+random(447);

    myGLCD.drawLine(x, y, x2, y2);

  }

 

  delay(2000);

  

  myGLCD.setColor(0,0,0);

  myGLCD.fillRect(1,15,798,464);

 

  for (int i=0; i<10000; i++)

  {

    myGLCD.setColor(random(255), random(255), random(255));

    myGLCD.drawPixel(2+random(796), 16+random(447));

  }

 

  delay(2000);

 

  myGLCD.fillScr(0, 0, 255);

  myGLCD.setColor(255, 0, 0);

  myGLCD.fillRoundRect(320, 190, 479, 289);

  

  myGLCD.setColor(255, 255, 255);

  myGLCD.setBackColor(255, 0, 0);

  myGLCD.print("That's it!", CENTER, 213);

  myGLCD.print("Restarting in a", CENTER, 239);

  myGLCD.print("few seconds...", CENTER, 252);

  

  myGLCD.setColor(0, 255, 0);

  myGLCD.setBackColor(0, 0, 255);

  myGLCD.print("Runtime: (msecs)", CENTER, 450);

  myGLCD.printNumI(millis(), CENTER, 465);

  

  delay (10000);

}

Posted by RDIoT
|

2.4 Inch TFT Touch LCD Shield (ST7781) [D001]



Loading Graphic : https://www.youtube.com/watch?v=GYCeGMsrbFA


Draw :  https://www.youtube.com/watch?v=PJ1l4Nn3UVw


* GitHub https://github.com/rdiot/rdiot-d001.git


* Specs

There’s no doubt Arduino has quickly become the world’s most popular do-it-yourself microcontroller board system, thanks to its simplicity, versatility and surprisingly low cost. But the key to that versatility is its Shield header that allows daughter boards or ‘shields’ to extend the Arduino’s functionality. In the last project, we built a digital clock project using the popular 1602 alphanumeric LCD shield and it’s hopefully had your mind ticking over with other ideas and possibilities. This month, we’re going a step further, introducing a new low-cost shield that incorporates a 320 x 240-pixel TFT LCD touchscreen.


The ST7781 is a single-chip controller/driver for 262K-color, graphic type TFT-LCD. It consists of 720 source line and

320 gate line driving circuits. This chip is capable of connecting directly to an external microprocessor, and accepts,

8-bits/9-bits/16-bits/18-bits parallel interface. Display data can be stored in the on-chip display data RAM of 240x320x18

bits. It can perform display data RAM read/write operation with no external operation clock to minimize power

consumption. In addition, because of the integrated power supply circuits necessary to drive liquid crystal, it is possible to

make a display system with the fewest components. 


Driver Output:

- 720ch Source Outputs (240 X RGB)

- 320ch Gate Outputs

- Common Electrode Output 


Single Chip Display RAM:

-Capacity: 240x320x18 bit 


Support Display Color

- 65K Color

- 262K Color

- 8-color (Idle Mode) 


Supported LC Type Option

- MVA LC Type

- Transflective LC Type

- Transmissive LC Type 


Supported MCU Interface

- 8/9/16/18-bit Interface with 8080-Series MCU 


Display Features

- Partial Display Mode

- Resizing Function (x1/2, x1/4)


Build-in Circuit

- DC/DC Converter

- Adjustable VCOM Generation

- Oscillator for Display Clock Generation

- Timing Controller

- Non-volatile Memory for Factory Default Value

- Line Inversion, Frame Inversion 


Non-Volatile Memory

- 7-bits for ID Code

- 5-bits for VCOM Adjustment 


Supply Voltage Range

- Analog Supply Voltage (VDD) Range: 2.5V to 3.3V

- I/O Supply Voltage (VDDI) Range: 1.65V to 3.3V


Output Voltage Level

- GVDD – AGND: 3V to (AVDD-0.5) V

- AVDD – AGND: 4.5V to 5.6V

- VCL – AGND: -2.0V to -3.0V

- VCOMH – AGND: 3.0V to (AVDD-0.5) V

- VCOML – AGND: (VCL+0.5) V to 0.0V

- VGH – AGND: 10V to 16.5V

- VGL – AGND: -5V to -14V 


Lower Power Consumption

- CMOS Compatible Inputs

- Optimized Layout for COG Assembly

- Operate Temperature Range: -30 ℃ ~ +85℃



* Contents

- DataSheet : http://www.rockbox.org/wiki/pub/Main/SansaFuzePlus/ST7781.pdf

- Library1 : https://github.com/samuraijap/TFTLCD-Library  

- Library2 : https://github.com/adafruit/Adafruit-GFX-Library


- Tested Library : TFTLCD_Rack_Dongari_tftpaint_fixed.zip

modify 

ili9341(2.4inch 240x320)

#define TFTWIDTH   240

#define TFTHEIGHT  320

//#define TFTWIDTH   320

//#define TFTHEIGHT  480


identifier == 0x9325

uint16_t identifier = tft.readID();

TFT size is 240x320

Found ILI9325 LCD driver 


- Connect / Pin Map

A0 LCD_RD

A1 LCD_WR / TS_YP

A2 LCD_RS / TS_XM

A3 LCD_CS

A4 LCD_RST

D8 LCD_D0

D9 LCD_D1

D2 LCD_D2

D3 LCD_D3

D4 LCD_D4

D5 LCD_D5

D6 LCD_D6 / TS_XP

D7 LCD_D7 / TS_YM

D8 SD_SS

D9 SD_DI

D10 SD_DO

D11 SD_SCK

Posted by RDIoT
|

ACS712T Current Sensor Module 20A (ACS712T) [B039]



https://www.youtube.com/watch?v=6NuyGoSPYO4


* Specs

Supply Voltage (VCC) 5Vdc Nominal

Measurement Range -20 to +20 Amps

Voltage at 0A VCC/2 (nominally 2.5Vdc)

Scale Factor 100 mV per Amp

Chip ACS712ELC-10A


* Contents

- Connect

VCC ---- 5V 

OUT ----- A0 

GND ----- GND 


Power+VCC -> Load/Sensor -> ACS712T (UP)

Power GND  ---------------> ACS712T (DOWN)


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


const int analogIn = A0;

int mVperAmp = 100; // use 100 for 20A Module and 66 for 30A Module

int RawValue= 0;

int ACSoffset = 2512; // default 2500 but i checked when this is disconnected to 2512

double Voltage = 0;

double Amps = 0;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(analogIn,INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B039:ACS712T Current");


  RawValue = analogRead(analogIn);

  Voltage = (RawValue / 1023.0) * 5000; // Gets you mV

  Amps = ((Voltage - ACSoffset) / mVperAmp);


  lcd.setCursor(0,1);

  lcd.print("RawValue=" + (String)RawValue + "  ");


  lcd.setCursor(0,2);

  lcd.print("Voltage=" + (String)Voltage + "");


  lcd.setCursor(0,3);

  lcd.print("=>Current=" + (String)Amps + " A ");  


  delay(1500);

}

Posted by RDIoT
|

B25 Voltage Sensor DC0~25V [B125]




https://www.youtube.com/watch?v=cOpQqT2XffQ


* GitHubhttps://github.com/rdiot/rdiot-b125.git

* Specs

Voltage input: DC0-25V

Voltage detection range:DC0.02445V-25V

Voltage analog resolution:0.00489V


* Contents

- Connect

GND ----- GND

VCC ----- X

S ----- A1 


- Key Code

#include <Wire.h>

float val11; 

float val2;

void setup() 

{   

 //pinMode(LED1,OUTPUT);   

 Serial.begin(9600);   

 Serial.println("Emartee.Com");   

 Serial.println("Voltage: ");   

 Serial.print("V"); 

void loop() 

{       

 float temp;       

 val11=analogRead(1);       

 temp=val11/4.092;       

 Serial.print("analog:"+(String)val11+", "+(String)val11+"/4.092="+(String)temp);

 val11=temp;

 val2=((val11)*10)/100;       

 Serial.println(" =====> "+(String)val2+" V");          

 delay(1000); 

}

Posted by RDIoT
|

84x84 Nokia 5110 LCD Module (LCD5110) [D055]



https://www.youtube.com/watch?v=PvXZjwpwZQA


*GitHubhttps://github.com/rdiot/rdiot-d055.git


* Specs

Power supply voltage: 2.7V-3.3V,5V is OK,but part of the screen becomes black when tested

Data interface level: 2.7-5V

Backlight power supply voltage: highest 3.3V

Module size: 43.6mm x 43.1mm(width X height)

Installation diameter: 2mm

Backlight: White


Features : 

84 X 84 dot matrix LCD,can show 4 lines of characters

Use serial interface communicate with the master processor,the number of interface signal line reduced greatly, only 8 signal lines including power and GND.Support different types of MCU,such as the SPI,MCS51 serial mode 0 of AVR.Transfer rate up to 4Mbps,can full speed write display data without waiting time.

Can use the conductive glue to connect the module with the printed board,without connecting cable.The metal hooks on the module can fix the module on the printed board,which is very easy to install and replace.

LCD controller/driver chip has been bound to LCD chip,the volume of LCD is small

Low power supply,the working current in normal situation is lower than 200μA,and has power-down mode



* Contents

- Library1 :  https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library

- Library2 : https://github.com/adafruit/Adafruit-GFX-Library


- Connect

RST ----- D3

CE ----- D4

DC ----- D5

Din ----- D6

CLK ----- D7

VCC ----- 5V

BL ----- 5V / GND

GND ----- GND


- Key Code Sample

/*********************************************************************

This is an example sketch for our Monochrome Nokia 5110 LCD Displays


  Pick one up today in the adafruit shop!

  ------> http://www.adafruit.com/products/338


These displays use SPI to communicate, 4 or 5 pins are required to

interface


Adafruit invests time and resources providing this open source code,

please support Adafruit and open-source hardware by purchasing

products from Adafruit!


Written by Limor Fried/Ladyada  for Adafruit Industries.

BSD license, check license.txt for more information

All text above, and the splash screen must be included in any redistribution

*********************************************************************/


#include <SPI.h>

#include <Adafruit_GFX.h>

#include <Adafruit_PCD8544.h>


// Software SPI (slower updates, more flexible pin options):

// pin 7 - Serial clock out (SCLK)

// pin 6 - Serial data out (DIN)

// pin 5 - Data/Command select (D/C)

// pin 4 - LCD chip select (CS)

// pin 3 - LCD reset (RST)

Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);


// Hardware SPI (faster, but must use certain hardware pins):

// SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno

// MOSI is LCD DIN - this is pin 11 on an Arduino Uno

// pin 5 - Data/Command select (D/C)

// pin 4 - LCD chip select (CS)

// pin 3 - LCD reset (RST)

// Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3);

// Note with hardware SPI MISO and SS pins aren't used but will still be read

// and written to during SPI transfer.  Be careful sharing these pins!


#define NUMFLAKES 10

#define XPOS 0

#define YPOS 1

#define DELTAY 2



#define LOGO16_GLCD_HEIGHT 16

#define LOGO16_GLCD_WIDTH  16


static const unsigned char PROGMEM logo16_glcd_bmp[] =

{ B00000000, B11000000,

  B00000001, B11000000,

  B00000001, B11000000,

  B00000011, B11100000,

  B11110011, B11100000,

  B11111110, B11111000,

  B01111110, B11111111,

  B00110011, B10011111,

  B00011111, B11111100,

  B00001101, B01110000,

  B00011011, B10100000,

  B00111111, B11100000,

  B00111111, B11110000,

  B01111100, B11110000,

  B01110000, B01110000,

  B00000000, B00110000 };


void setup()   {

  Serial.begin(9600);


  display.begin();

  // init done


  // you can change the contrast around to adapt the display

  // for the best viewing!

  display.setContrast(50);


  display.display(); // show splashscreen

  delay(2000);

  display.clearDisplay();   // clears the screen and buffer


  // draw a single pixel

  display.drawPixel(10, 10, BLACK);

  display.display();

  delay(2000);

  display.clearDisplay();


  // draw many lines

  testdrawline();

  display.display();

  delay(2000);

  display.clearDisplay();


  // draw rectangles

  testdrawrect();

  display.display();

  delay(2000);

  display.clearDisplay();


  // draw multiple rectangles

  testfillrect();

  display.display();

  delay(2000);

  display.clearDisplay();


  // draw mulitple circles

  testdrawcircle();

  display.display();

  delay(2000);

  display.clearDisplay();


  // draw a circle, 10 pixel radius

  display.fillCircle(display.width()/2, display.height()/2, 10, BLACK);

  display.display();

  delay(2000);

  display.clearDisplay();


  testdrawroundrect();

  delay(2000);

  display.clearDisplay();


  testfillroundrect();

  delay(2000);

  display.clearDisplay();


  testdrawtriangle();

  delay(2000);

  display.clearDisplay();

   

  testfilltriangle();

  delay(2000);

  display.clearDisplay();


  // draw the first ~12 characters in the font

  testdrawchar();

  display.display();

  delay(2000);

  display.clearDisplay();


  // text display tests

  display.setTextSize(1);

  display.setTextColor(BLACK);

  display.setCursor(0,0);

  display.println("Hello, world!");

  display.setTextColor(WHITE, BLACK); // 'inverted' text

  display.println(3.141592);

  display.setTextSize(2);

  display.setTextColor(BLACK);

  display.print("0x"); display.println(0xDEADBEEF, HEX);

  display.display();

  delay(2000);


  // rotation example

  display.clearDisplay();

  display.setRotation(1);  // rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further.

  display.setTextSize(1);

  display.setTextColor(BLACK);

  display.setCursor(0,0);

  display.println("Rotation");

  display.setTextSize(2);

  display.println("Example!");

  display.display();

  delay(2000);


  // revert back to no rotation

  display.setRotation(0);


  // miniature bitmap display

  display.clearDisplay();

  display.drawBitmap(30, 16,  logo16_glcd_bmp, 16, 16, 1);

  display.display();


  // invert the display

  display.invertDisplay(true);

  delay(1000); 

  display.invertDisplay(false);

  delay(1000); 


  // draw a bitmap icon and 'animate' movement

  testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_WIDTH, LOGO16_GLCD_HEIGHT);

}



void loop() {

  

}



void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {

  uint8_t icons[NUMFLAKES][3];

  randomSeed(666);     // whatever seed

 

  // initialize

  for (uint8_t f=0; f< NUMFLAKES; f++) {

    icons[f][XPOS] = random(display.width());

    icons[f][YPOS] = 0;

    icons[f][DELTAY] = random(5) + 1;

    

    Serial.print("x: ");

    Serial.print(icons[f][XPOS], DEC);

    Serial.print(" y: ");

    Serial.print(icons[f][YPOS], DEC);

    Serial.print(" dy: ");

    Serial.println(icons[f][DELTAY], DEC);

  }


  while (1) {

    // draw each icon

    for (uint8_t f=0; f< NUMFLAKES; f++) {

      display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);

    }

    display.display();

    delay(200);

    

    // then erase it + move it

    for (uint8_t f=0; f< NUMFLAKES; f++) {

      display.drawBitmap(icons[f][XPOS], icons[f][YPOS],  logo16_glcd_bmp, w, h, WHITE);

      // move it

      icons[f][YPOS] += icons[f][DELTAY];

      // if its gone, reinit

      if (icons[f][YPOS] > display.height()) {

 icons[f][XPOS] = random(display.width());

 icons[f][YPOS] = 0;

 icons[f][DELTAY] = random(5) + 1;

      }

    }

   }

}



void testdrawchar(void) {

  display.setTextSize(1);

  display.setTextColor(BLACK);

  display.setCursor(0,0);


  for (uint8_t i=0; i < 168; i++) {

    if (i == '\n') continue;

    display.write(i);

    //if ((i > 0) && (i % 14 == 0))

      //display.println();

  }    

  display.display();

}


void testdrawcircle(void) {

  for (int16_t i=0; i<display.height(); i+=2) {

    display.drawCircle(display.width()/2, display.height()/2, i, BLACK);

    display.display();

  }

}


void testfillrect(void) {

  uint8_t color = 1;

  for (int16_t i=0; i<display.height()/2; i+=3) {

    // alternate colors

    display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);

    display.display();

    color++;

  }

}


void testdrawtriangle(void) {

  for (int16_t i=0; i<min(display.width(),display.height())/2; i+=5) {

    display.drawTriangle(display.width()/2, display.height()/2-i,

                     display.width()/2-i, display.height()/2+i,

                     display.width()/2+i, display.height()/2+i, BLACK);

    display.display();

  }

}


void testfilltriangle(void) {

  uint8_t color = BLACK;

  for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {

    display.fillTriangle(display.width()/2, display.height()/2-i,

                     display.width()/2-i, display.height()/2+i,

                     display.width()/2+i, display.height()/2+i, color);

    if (color == WHITE) color = BLACK;

    else color = WHITE;

    display.display();

  }

}


void testdrawroundrect(void) {

  for (int16_t i=0; i<display.height()/2-2; i+=2) {

    display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, BLACK);

    display.display();

  }

}


void testfillroundrect(void) {

  uint8_t color = BLACK;

  for (int16_t i=0; i<display.height()/2-2; i+=2) {

    display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, color);

    if (color == WHITE) color = BLACK;

    else color = WHITE;

    display.display();

  }

}

   

void testdrawrect(void) {

  for (int16_t i=0; i<display.height()/2; i+=2) {

    display.drawRect(i, i, display.width()-2*i, display.height()-2*i, BLACK);

    display.display();

  }

}


void testdrawline() {  

  for (int16_t i=0; i<display.width(); i+=4) {

    display.drawLine(0, 0, i, display.height()-1, BLACK);

    display.display();

  }

  for (int16_t i=0; i<display.height(); i+=4) {

    display.drawLine(0, 0, display.width()-1, i, BLACK);

    display.display();

  }

  delay(250);

  

  display.clearDisplay();

  for (int16_t i=0; i<display.width(); i+=4) {

    display.drawLine(0, display.height()-1, i, 0, BLACK);

    display.display();

  }

  for (int8_t i=display.height()-1; i>=0; i-=4) {

    display.drawLine(0, display.height()-1, display.width()-1, i, BLACK);

    display.display();

  }

  delay(250);

  

  display.clearDisplay();

  for (int16_t i=display.width()-1; i>=0; i-=4) {

    display.drawLine(display.width()-1, display.height()-1, i, 0, BLACK);

    display.display();

  }

  for (int16_t i=display.height()-1; i>=0; i-=4) {

    display.drawLine(display.width()-1, display.height()-1, 0, i, BLACK);

    display.display();

  }

  delay(250);


  display.clearDisplay();

  for (int16_t i=0; i<display.height(); i+=4) {

    display.drawLine(display.width()-1, 0, 0, i, BLACK);

    display.display();

  }

  for (int16_t i=0; i<display.width(); i+=4) {

    display.drawLine(display.width()-1, 0, i, display.height()-1, BLACK); 

    display.display();

  }

  delay(250);

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD 4002 Blue (ERM4002SBS-1) [D051]  (0) 2016.09.21
LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
Posted by RDIoT
|

LCD 4002 Blue (ERM4002SBS-1) [D051]



https://www.youtube.com/watch?v=kB6cak9ngwI


*GitHubhttps://github.com/rdiot/rdiot-d051.git


* Specs

Gross Weight (kg) 0.12

Manufacturer EastRising

Continuity Supply We promise the long term continuity supply for this product no less than 10 years since 2015.

Part Number ERM4002SBS-1

Display Format 40x2 Character

Interface 6800 4-bit Parallel , 6800 8-bit Parallel

IC or Equivalent AIP31066 , HD44780, KS0066 , SPLC780 , ST7066

Appearance White on Blue

Diagonal Size No

Connection Pin Header

Outline Dimension 182.00(W)x33.5(H)x13.6(T)mm

Visual Area 152.30x16.70mm

Active Area 147.50(W)x11.50(H)mm

Character Size 3.20x5.55mm

Dot (Pixel) Size 0.60x0.65mm

Dot (Pixel) Pitch 0.65x0.70mm

IC Package COB

Display Type STN-LCD Blue

Touch Panel Optional No

Sunlight Readable No

Response Time(Typ) No

Contrast Ratio(Typ) No

Colors No

Viewing Direction 0.25

Viewing Angle Range No

Brightness(Typ) No

Backlight Color White Color

Backlight Current (Typ) 30mA

Power Supply(Typ) 5V

Supply Current for LCM(Max) 2200uA

Operating Temperature -20C~70C

Storage Temperature -30C~80C

Series Number ERM4002-1 


* Contents

- Controller DataSheet : http://www.buydisplay.com/download/ic/SPLC780.pdf


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,40,2);  // LCD4002


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD4002");

  

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D051:LCD4002");


  String str="";

  for(char i='A'; i<='Z'; i++)

  {

    str += (String)i;

    lcd.setCursor(0,1);  

    lcd.print(str);


    delay(50);

  }

  

  str +=" ";


  for(int i=1; i<=10; i++)

  {

    str += (String)i;

    lcd.setCursor(0,1);  

    lcd.print(str);


    delay(300);

  }

}

Posted by RDIoT
|

LCD2004 I2C Green (LCD2004A) [D046]



https://www.youtube.com/watch?v=rVxFB_l_hGc


*GitHub : https://github.com/rdiot/rdiot-d046.git

* Contents

- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display

 

void setup()

{

  lcd.init();                      // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

  lcd.setCursor(4,0);

  lcd.print("Hello, World");

  lcd.setCursor(2,1);

  lcd.print("LCD2004 I2C TEST");

   lcd.setCursor(0,2);

  lcd.print("Arduino LCM IIC 2004");

   lcd.setCursor(2,3);

  lcd.print("Always thank you.");

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
LCD1602 I2C (LCD1602) [D016]  (0) 2016.09.21
LCD1602 (HD44780) [D002]  (0) 2016.09.21
Posted by RDIoT
|

LCD2004 I2C ( LCD2004A) [D017]



https://www.youtube.com/watch?v=Yt-eYSfoH1M


*GitHub : https://github.com/rdiot/rdiot-d017.git



* Contents

- DataSheet : http://www.elecrow.com/download/2004%20Datasheet.pdf

- Connect

GND  ------------------  GND

VCC  ------------------   5V

SDA  ------------------   A4

SCL  ------------------   A5

: Mega(SDA-D20, SCL-D21), Leo(SDA-D2, SCL-D3)


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x20 for a 16 chars and 2 line display

 

void setup()

{

  lcd.init();                      // initialize the lcd 

  // Print a message to the LCD.

  lcd.backlight();

  lcd.setCursor(4,0);

  lcd.print("Hello, World");

  lcd.setCursor(2,1);

  lcd.print("LCD2004 I2C TEST");

   lcd.setCursor(0,2);

  lcd.print("Arduino LCM IIC 2004");

   lcd.setCursor(2,3);

  lcd.print("Always thank you.");

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD1602 I2C (LCD1602) [D016]  (0) 2016.09.21
LCD1602 (HD44780) [D002]  (0) 2016.09.21
Posted by RDIoT
|

LCD1602 I2C (LCD1602) [D016]



https://www.youtube.com/watch?v=xj6KmHnGYqE


*GitHubhttps://github.com/rdiot/rdiot-d016.git



* Contents

- Connect

GND  ------------------  GND

VCC  ------------------   5V

SDA  ------------------   A4 

SCL  ------------------   A5 

: Mega(SDA-D20, SCL-D21), Leo(SDA-D2, SCL-D3)


- DataSheet : http://www.elecrow.com/download/LCD1602.pdf


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x20 for a 16 chars and 2 line display

 

void setup()

{

  lcd.init();                      // initialize the lcd 

 

  // Print a message to the LCD.

  lcd.backlight();

  lcd.print("Hello, world!");

  

  lcd.setCursor(0, 1);

 

  lcd.print("cursor 0,1");

}

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
LCD1602 (HD44780) [D002]  (0) 2016.09.21
Posted by RDIoT
|

LCD1602 (HD44780) [D002]



https://www.youtube.com/watch?v=j3BCNsJCj4I


*GitHubhttps://github.com/rdiot/rdiot-d002.git


* Contents

- DataSheet : http://www.elecrow.com/download/LCD1602.pdf

- Connect

LiquidCrystal lcd(9, 8, 7, 6, 5, 4);

/*

[LCD Pin Number][BreadBoard][Arduino]

1.  Vss------------------ - GND------------------ - GND  ---> GND

2.  Vdd------------------ - VCC------------------ - 5V   ---> 5V (+)

3.  V0------------------ - GND                           ---> R4.7K

4.  RS----------------------------------------------------D13  ------------> RS D9

5.  RW------------------ - GND                           ------------> GND

6.  E----------------------------------------------------D12   ------------> RS D8

7.  DB0(X)

8.  DB1(X)

9.  DB2(X)

10. DB3(X)

11  DB4----------------------------------------------------D11 ----------> 7

12  DB5----------------------------------------------------D10 ----------> 6

13  DB6----------------------------------------------------D9  ----------> 5

14  DB7----------------------------------------------------D8  ----------> 4

15  LEDA------------------ - VCC                         -----> R220 ---- VCC

16  LEDK------------------ - GND                         -----> GND

*/


- Test Example : SerialDisplay

'3) Actuator > LCD' 카테고리의 다른 글

LCD Keypad Shield Green (LCD1602) [D043]  (0) 2016.09.21
LCD Keypad Shield (LCD1602) [D038]  (0) 2016.09.21
LCD2004 I2C Green (LCD2004A) [D046]  (0) 2016.09.21
LCD2004 I2C ( LCD2004A) [D017]  (0) 2016.09.21
LCD1602 I2C (LCD1602) [D016]  (0) 2016.09.21
Posted by RDIoT
|

NeoPixel Stick - 8 x WS2812 (5050RGB) [D009]



https://www.youtube.com/watch?v=55YDvXyeVjc


*GitHub : https://github.com/rdiot/rdiot-d009.git


* Specs

Make your own little LED strip arrangement with this stick of NeoPixel LEDs. We crammed 8 of the tiny 5050 (5mm x 5mm) smart RGB LEDs onto a PCB with mounting holes and a chainable design. Use only one microcontroller pin to control as many as you can chain together! Each LED is addressable as the driver chip is inside the LED. Each one has ~18mA constant current drive so the color will be very consistent even if the voltage varies, and no external choke resistors are required making the design slim. Power the whole thing with 5VDC (4-7V works) and you're ready to rock.

Product Url : https://www.adafruit.com/products/1426


* Contents

- Connect

GND ----- GND

4-7VDC ----- 5V

DIN ----- D6


- Library : https://github.com/adafruit/Adafruit_NeoPixel


- Key Code (Example : Standardtest.ino)

#include <Adafruit_NeoPixel.h>

#ifdef __AVR__

  #include <avr/power.h>

#endif

 

#define PIN 6

 

// Parameter 1 = number of pixels in strip

// Parameter 2 = Arduino pin number (most are valid)

// Parameter 3 = pixel type flags, add together as needed:

//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)

//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)

//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)

//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

 

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across

// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input

// and minimize distance between Arduino and first pixel.  Avoid connecting

// on a live circuit...if you must, connect GND first.

 

void setup() {

  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket

  #if defined (__AVR_ATtiny85__)

    if (F_CPU == 16000000) clock_prescale_set(clock_div_1);

  #endif

  // End of trinket special code

 

 

  strip.begin();

  strip.show(); // Initialize all pixels to 'off'

}

 

void loop() {

  // Some example procedures showing how to display to the pixels:

  colorWipe(strip.Color(255, 0, 0), 50); // Red

  colorWipe(strip.Color(0, 255, 0), 50); // Green

  colorWipe(strip.Color(0, 0, 255), 50); // Blue

  // Send a theater pixel chase in...

  theaterChase(strip.Color(127, 127, 127), 50); // White

  theaterChase(strip.Color(127, 0, 0), 50); // Red

  theaterChase(strip.Color(0, 0, 127), 50); // Blue

 

  rainbow(20);

  rainbowCycle(20);

  theaterChaseRainbow(50);

}

 

// Fill the dots one after the other with a color

void colorWipe(uint32_t c, uint8_t wait) {

  for(uint16_t i=0; i<strip.numPixels(); i++) {

    strip.setPixelColor(i, c);

    strip.show();

    delay(wait);

  }

}

 

void rainbow(uint8_t wait) {

  uint16_t i, j;

 

  for(j=0; j<256; j++) {

    for(i=0; i<strip.numPixels(); i++) {

      strip.setPixelColor(i, Wheel((i+j) & 255));

    }

    strip.show();

    delay(wait);

  }

}

 

// Slightly different, this makes the rainbow equally distributed throughout

void rainbowCycle(uint8_t wait) {

  uint16_t i, j;

 

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel

    for(i=0; i< strip.numPixels(); i++) {

      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));

    }

    strip.show();

    delay(wait);

  }

}

 

//Theatre-style crawling lights.

void theaterChase(uint32_t c, uint8_t wait) {

  for (int j=0; j<10; j++) {  //do 10 cycles of chasing

    for (int q=0; q < 3; q++) {

      for (int i=0; i < strip.numPixels(); i=i+3) {

        strip.setPixelColor(i+q, c);    //turn every third pixel on

      }

      strip.show();

 

      delay(wait);

 

      for (int i=0; i < strip.numPixels(); i=i+3) {

        strip.setPixelColor(i+q, 0);        //turn every third pixel off

      }

    }

  }

}

 

//Theatre-style crawling lights with rainbow effect

void theaterChaseRainbow(uint8_t wait) {

  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel

    for (int q=0; q < 3; q++) {

      for (int i=0; i < strip.numPixels(); i=i+3) {

        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on

      }

      strip.show();

 

      delay(wait);

 

      for (int i=0; i < strip.numPixels(); i=i+3) {

        strip.setPixelColor(i+q, 0);        //turn every third pixel off

      }

    }

  }

}

 

// Input a value 0 to 255 to get a color value.

// The colours are a transition r - g - b - back to r.

uint32_t Wheel(byte WheelPos) {

  WheelPos = 255 - WheelPos;

  if(WheelPos < 85) {

    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);

  }

  if(WheelPos < 170) {

    WheelPos -= 85;

    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);

  }

  WheelPos -= 170;

  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);

}

Posted by RDIoT
|

6bits Multicolor Rapid Prototyping LED [D050]



https://www.youtube.com/watch?v=CSUq8nZIrKM


*GitHubhttps://github.com/rdiot/rdiot-d050.git


* Specs

2.54MM PIN 6 Digitals LED Board ,Can be inserted directly into Arduiuo UNO MEGA2560 DUE  Board ,Ideal for linking up to your Arduiuo UNO Pro Mini Nano Mega2560 DUE  Development  Board  etc,or others MCU  Embedded development board  (AVR STM32 STM8 STM0 ARM7 ARM9 ARM11 PIC C8051 C51 STC MSP430 FPGA/CPLD etc.) 


6 bit    6 colors   Common Cathode LEDs.

Multicolor are White Blue Chartreuse Yellow Pink Red.

7 PIN OUT  2.54mm

1K ohm   Limiting resistor

Power Supply Voltage: 3.3-12V

LED &  Resistor Package : 0603

Size: 17.78MM x 11.43MM


* Contents

- Key Code

int D1 = 13;//White

int D2 = 12;//Blue

int D3 = 11;//Chartreuse

int D4 = 10;//Yellow

int D5 = 9;//Pink

int D6 = 8;//Red

 

int GND = 7;//GND

int D11 = 6;//White

int D12 = 5;//Blue

int D13 = 4;//Chartreuse

int D14 = 3;//Yellow

int D15 = 2;//Pink

int D16 = 1;//Red

 

int i;


void setup() {                

pinMode(D1, OUTPUT);   

pinMode(D2, OUTPUT); 

pinMode(D3, OUTPUT);  

pinMode(D4, OUTPUT);  

pinMode(D5, OUTPUT);  

pinMode(D6, OUTPUT); 

 

pinMode(D11, OUTPUT);   

pinMode(D12, OUTPUT); 

pinMode(D13, OUTPUT);  

pinMode(D14, OUTPUT);  

pinMode(D15, OUTPUT);  

pinMode(D16, OUTPUT);  

pinMode(GND, OUTPUT);  

digitalWrite(GND, LOW); 

}

 

 

// the loop routine runs over and over again forever:

void loop() {

  

  //White LED light than any other color lights, so reducing the brightness

  for(i=0;i< ms_cnt/6;i++)

  {

  digitalWrite(D1, HIGH);   

  delay(1);              

  digitalWrite(D1, LOW);    

  delay(5);               

  }

  

  digitalWrite(D2, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(ms_cnt);               // wait for a Millisecond

  digitalWrite(D2, LOW);    // turn the LED off by making the voltage LOW

  

  digitalWrite(D3, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(ms_cnt);               // wait for a Millisecond

  digitalWrite(D3, LOW);    // turn the LED off by making the voltage LOW

 

  digitalWrite(D4, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(ms_cnt);               // wait for a Millisecond

  digitalWrite(D4, LOW);    // turn the LED off by making the voltage LOW

  

  digitalWrite(D5, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(ms_cnt);               // wait for a Millisecond

  digitalWrite(D5, LOW);    // turn the LED off by making the voltage LOW

  

  digitalWrite(D6, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(ms_cnt);               // wait for a Millisecond

  digitalWrite(D6, LOW);    // turn the LED off by making the voltage LOW

  

  //White LED light than any other color lights, so reducing the brightness

  for(i=0;i< ms_cnt/6;i++)

  {

    digitalWrite(D11, HIGH);   

    delay(1);              

    digitalWrite(D11, LOW);    

    delay(5);               

  } 


  digitalWrite(D12, HIGH); 

  delay(ms_cnt); 

  digitalWrite(D12, LOW); 

  

  digitalWrite(D13, HIGH); 

  delay(ms_cnt);

  digitalWrite(D13, LOW); 

 

  digitalWrite(D14, HIGH); 

  delay(ms_cnt); 

  digitalWrite(D14, LOW); 

  

  digitalWrite(D15, HIGH); 

  delay(ms_cnt); 

  digitalWrite(D15, LOW); 

  

  digitalWrite(D16, HIGH); 

  delay(ms_cnt); 

  digitalWrite(D16, LOW); 

}

Posted by RDIoT
|

Bargraph Segment LED Module (SHB10R) [D024]



https://www.youtube.com/watch?v=-Qtzp6CA7Cc


*GitHubhttps://github.com/rdiot/rdiot-d024.git


* Specs

These 10 segment bar graph LEDs have many uses. With a compact footprint, and a simple hookup, they are easy for prototyping or finished products. Essentially, they are 10 individual red LEDs housed together.


Forward Current (Per Segment): 25mA

Max Reverse Voltage: 5v

10 segment bar

Color: Super Bright Red

Industrial standard size

Low power consumption

Categorized for luminous intensity 


* Contents

- Connect

1  ----- D2  - R220 - GND

2  ----- D3  - R220 - GND

3  ----- D4  - R220 - GND

4  ----- D5  - R220 - GND

5  ----- D6  - R220 - GND

6  ----- D7  - R220 - GND

7  ----- D8  - R220 - GND

8  ----- D9  - R220 - GND

9  ----- D10  - R220 - GND

10  ----- D11  - R220 - GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int segPins[] = { 2,3,4,5,6,7,8,9,10,11 };

int idxBar = 0;

int minVal = 50;

int maxVal = 350;

int delayTime = 200;

 

byte digitsFill[10][10] = {

  {1,0,0,0,0,0,0,0,0,0},

  {1,1,0,0,0,0,0,0,0,0},

  {1,1,1,0,0,0,0,0,0,0},

  {1,1,1,1,0,0,0,0,0,0},

  {1,1,1,1,1,0,0,0,0,0},

  {1,1,1,1,1,1,0,0,0,0},

  {1,1,1,1,1,1,1,0,0,0},

  {1,1,1,1,1,1,1,1,0,0},

  {1,1,1,1,1,1,1,1,1,0},

  {1,1,1,1,1,1,1,1,1,1}

};

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  for (int i=0; i<11; i++)

  {

    pinMode(segPins[i], OUTPUT);

  }

 

  delay(1000);

 

  lcd.clear();

}

 

void loop()

{

  lcd.setCursor(0,0);

  lcd.print("D024:Bargraph LED");

 

  idxBar = map(analogRead(A0), minVal, maxVal, 0, 9);

 

  lcd.setCursor(0,1);

  lcd.print("analog=" + (String)analogRead(A0) + "  ");

 

  for(int j=0; j<10; j++)

  {

    digitalWrite(segPins[j], digitsFill[idxBar][j]);

 

    lcd.setCursor(0,2);

    lcd.print("idxBar="+(String)idxBar+" "); 

  }

   delay(delayTime);

}

'3) Actuator > LED' 카테고리의 다른 글

12V 4W 48 COB LED Lamp Light [D078]  (0) 2016.09.19
Arrow Indicator 14 SMD LED Blue [D077]  (0) 2016.09.19
Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED Module DIP (KY-016) [D007]  (0) 2016.09.18
Posted by RDIoT
|

Magic Cup Light Module (KY-027) [D020]



https://www.youtube.com/watch?v=yrBU-JRPk8M


*GitHub : https://github.com/rdiot/rdiot-d020.git


* Specs

Magic Light Cup modules are easy to Interactive Technology Division developed a can and ARDUINO interactive modules, PWM dimming principle is to use the principle of two modules brightness changes. Mercury switches provide a digital signal that triggers the PWM regulator, through the program design, We can see the light like two cups filled with the effect of shuffling back and forth.


* Contents

- Connect

G ----- GND

+ ----- X

S ----- D10

L ----- D11


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

 

LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

 

int pinLed = 11;

int pinInput = 10;

 

int stateA = 0;

int brightness = 0;

int oldBrightness = 0;

 

void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");

 

  pinMode(pinLed, OUTPUT);

  pinMode(pinInput, INPUT);  delay(1000);

  digitalWrite(pinInput, HIGH);

 

  lcd.clear();

}

 

void loop()

  lcd.setCursor(0,0);

  lcd.print("D020:Magic Cup Light");

 

  stateA = digitalRead(pinInput);

 

  if (stateA == HIGH && brightness < 255)

    brightness++;

  if (stateA == LOW && brightness >0)

    brightness--;

  if (oldBrightness != brightness)

  {

    lcd.setCursor(0,1);

    lcd.print("brightness=" + (String)brightness + "  ");

  }

  oldBrightness = brightness;

  analogWrite(pinLed, brightness);

  delay(10); 

}

'3) Actuator > LED' 카테고리의 다른 글

Arrow Indicator 14 SMD LED Blue [D077]  (0) 2016.09.19
Bargraph Segment LED Module (SHB10R) [D024]  (0) 2016.09.19
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED Module DIP (KY-016) [D007]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
Posted by RDIoT
|

RGB LED Module SMD (KY-009) [D008]



https://www.youtube.com/watch?v=XQI3KhjrwfY


*GitHubhttps://github.com/rdiot/rdiot-d008.git


* Specs

Using 5050 full color LED with max current of 20mA

Forward Voltage : Red 1.80V (2.4 max), Green,Blue 2.8V (3.6V)

RGB trichromatic limiting resistor to prevent burnout

through the PWM adjusting three primary colors can be mixed to obtain different colors

with a variety of single-chip interface

Operating voltage: 5V

LED drive mode: common cathode driver


* Contents

- Connect

B ----- D9

R ----- D11

G ----- D10

- ----- 3.3V or 5V 


- Key Code

int B = 9; // OUTPUT PIN blue

int R = 11; // OUTPUT PIN red

int G = 10; // OUTPUT PIN green

 

void setup()

{

 Serial.begin(115200); 

 Serial.println("Arduino Examples - RGB LED");

 pinMode(R, OUTPUT);

 pinMode(G, OUTPUT);

 pinMode(B, OUTPUT);

}

 

void loop()

 // RED

 digitalWrite(R, LOW);

 digitalWrite(G, HIGH);

 digitalWrite(B, HIGH);

 delay(1000);

 

 // GREEN

 digitalWrite(R, HIGH);

 digitalWrite(G, LOW);

 delay(1000);

 

 // BLUE

 digitalWrite(G, HIGH);

 digitalWrite(B, LOW);

 delay(1000);

 

 // RED + GREEN = YELLOW

 digitalWrite(B, HIGH);

 digitalWrite(R, LOW);

 digitalWrite(G, LOW);

 delay(1000);

 

 // RED + BLUE = MAGENTA

 digitalWrite(B, LOW);

 digitalWrite(R, LOW);

 digitalWrite(G, HIGH);

 delay(1000);

 

 // GREEN + BLUE = CYON

 digitalWrite(B, LOW);

 digitalWrite(R, HIGH);

 digitalWrite(G, LOW);

 delay(1000);

 

 // RED + GREEN + BLUE = WHITE

 digitalWrite(B, LOW);

 digitalWrite(R, LOW);

 digitalWrite(G, LOW);

 delay(1000);

 

 // ALL OFF

 digitalWrite(B, HIGH);

 digitalWrite(R, HIGH);

 digitalWrite(G, HIGH);

 delay(1000);

}

'3) Actuator > LED' 카테고리의 다른 글

Bargraph Segment LED Module (SHB10R) [D024]  (0) 2016.09.19
Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module DIP (KY-016) [D007]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
7 color flash LED Module (KY-034) [D010]  (0) 2016.09.18
Posted by RDIoT
|

RGB LED Module DIP (KY-016) [D007]



https://www.youtube.com/watch?v=CBWuVl1_O38


*GitHubhttps://github.com/rdiot/rdiot-d007.git


* Specs

Use of full color LED

RGB tricolor current-limiting resistance to prevent burn out

Through the PWM regulating three primary colors mixed with different colors

With a variety of single chip microcomputer interface

Working voltage: 5V

LED drive mode: Yin drive


* Contents

- Connect

R ----- D11

G ----- D10

B ----- D9

- ----- GND


- Key Code

int redPin = 11;

int greenPin = 10;

int bluePin = 9;

 

void setup()

{

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT); 

}

 

void loop()

{

  setColor(255, 0, 0); // red

  delay(1000);

  setColor(0, 255, 0); // green

  delay(1000);

  setColor(0, 0, 255); // blue

  delay(1000);

  setColor(255, 255, 0); // yellow

  delay(1000); 

  setColor(80, 0, 80); // purple

  delay(1000);

  setColor(0, 255, 255); // aqua

  delay(1000);

}

 

void setColor(int red, int green, int blue)

{

  analogWrite(redPin, red);

  analogWrite(greenPin, green);

  analogWrite(bluePin, blue); 

}

'3) Actuator > LED' 카테고리의 다른 글

Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
7 color flash LED Module (KY-034) [D010]  (0) 2016.09.18
2 Color(R,G) LED Module (KY-011) [D005]  (0) 2016.09.18
Posted by RDIoT
|

RGB LED (BL-L515) [D006]



https://www.youtube.com/watch?v=A9x5JjcyAf4


*GitHubhttps://github.com/rdiot/rdiot-d006.git


* Specs

5.0mm Round Type, RGB Full Color LED Lamps

Diffused and Water clear lens are available.

Popular T-1 diameter package.

IC compatible /Low current capability.

RoHs Compliance


* Contents

- DataSheet : http://www.alldatasheet.com/datasheet-pdf/pdf/699972/BETLUX/BL-L515.html


- Connect

R ----- D11

GND ----- GND

G ----- D10

B ----- D9


- Key Code

int redPin = 11;

int greenPin = 10;

int bluePin = 9;

 

void setup()

{

 pinMode(redPin, OUTPUT);

 pinMode(greenPin, OUTPUT);

 pinMode(bluePin, OUTPUT); 

}

 

void loop()

{

  setColor(255, 0, 0); // red

  delay(1000);

  setColor(0, 255, 0); // green

  delay(1000);

  setColor(0, 0, 255); // blue

  delay(1000);

  setColor(255, 255, 0); // yellow

  delay(1000); 

  setColor(80, 0, 80); // purple

  delay(1000);

  setColor(0, 255, 255); // aqua

  delay(1000);

}

 

void setColor(int red, int green, int blue)

{

  analogWrite(redPin, red);

  analogWrite(greenPin, green);

  analogWrite(bluePin, blue); 

}

Posted by RDIoT
|

7 color flash LED Module (KY-034) [D010]



https://www.youtube.com/watch?v=TN4ByfN2Esk


*GitHubhttps://github.com/rdiot/rdiot-d010.git


* Specs

Product Type: LED

Product Model: YB-3120B4PnYG-PM

Shape: Round LED 5mm DIP type

Color: pink yellow green (high brightness)

Lens type: white mist

Standard Forward Voltage :3.0-4 .5 V


* Contents

- Connect

S ----- D2

Middle ----- X 

- ----- GND


- Key Code

int R = 2;

 

void setup()

{

 Serial.begin(115200);

 Serial.println("Arduino Examples - 7 Color Flash");

 pinMode(R, OUTPUT);

 digitalWrite(R, LOW);

}

 

void loop()

{

 digitalWrite(R, HIGH); // on (for 5 Second)

 delay(5000); 

}

'3) Actuator > LED' 카테고리의 다른 글

Magic Cup Light Module (KY-027) [D020]  (0) 2016.09.18
RGB LED Module SMD (KY-009) [D008]  (0) 2016.09.18
RGB LED Module DIP (KY-016) [D007]  (0) 2016.09.18
RGB LED (BL-L515) [D006]  (0) 2016.09.18
2 Color(R,G) LED Module (KY-011) [D005]  (0) 2016.09.18
Posted by RDIoT
|