RGBDuino Manual V1.1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

1

CONTENTS
INTRODUCTION
IntronductiontoComponents
-RGBDuino Uno
- RGBDuino Uno Board
Setting up
-Dowload Arduino IDE
-Install RGBDuino UNO Drivers
-Install RGBDuino UNO libray

LESSONS
1. The
1. The led
led (Digital
(Digital OUTPUT)
OUTPUT)
2. LED
2. LED Blinking
Blinking
3. LED
3. LED OutPut
OutPut (PWM)
(PWM)
4. Push
4. Push Button
Button as Digital Input
5. Serial
5. Melody Dance
Write
6. Serial
6. RGB Blink
Read
7. Tone
7. Controlling
MelodyMotor
8. Potentiometer as Analog Input
9. LDR as Analog Input
10. Controlling Motor

PROJECTS
Interactive
2

www.RGBDuino.cn
INTRODUCTION

3
RGBDuino UNO
RGBDuino UNO compatible board designed and developed specially for
students to learn coding and microcontroller. We named it RGBDuino UNO to
encourage everyone to be a maker by getting started with this amazing board.

UNO Features:
-SMD ATmega328P microcontroller (the same microcontroller on Arduino
UNO)
- Input voltage: USB 5V, from computer,
power bank or standard USB adapter.
- 500mA (maximum) 3.3V voltage regulator.
- 0-5V outputs with 3.3V compatible inputs.
- 14 Digital I/O Pins (6 PWM outputs).
- 6 Analog Inputs.
- ISP 6-pin Header.
- 32k Flash Memory.
- 16MHz Clock Speed.
-10 blue LEDs and two RGB programmable lamps
-MICRO USB power and Programming port
-Buzzer that can play music
-More secure plug-in-free design
- On board programmable push button
- Use Micro-usb socket.
- Cute little yellow duck pattern!

4
Micro USB Connector
Main supply for RGBDuino Uno,Used for program
and debug purpose too.

Reset Button
Button to restart RGBDuino Uno program.

Programmable Button
This button is connected to Pin 2 and GND. To use
it ,user need to configure it as INPUT_PULLUP

PWM Pin ~
The digital pin that has this symbol can only use
analogWrite(); to control the output.

Series of LED for Digital I/O


Every digital IO is equipped with LED. where you can
control it as indicator for input.

Digital Pin
This pin can be used with :digitalRead();as an input
digitalWrite();as an output.

Piezo Buzzer Slide Swithc


Slide switch to connect between
pin 8 to piezo buzzer. To use piezo
buzzer,slide the switch on and
program the buzzer.To use pin 8 for
other Purpose ,slide the switch off.

Piezo Buzzer
Piezo buzzer is connected to Pin 8
through slide switch.
RGB lamp
Two RGB lamp is connected
to Pin12 and Pin13,
There is programmable lamps

Power Pin
GND-Ground Pins
5V-Regulated 5V output
3V3-Regualted 3.3v supply

Analog Pin
This pin can be used with
analogRead(); to read an input in
analog form (0~1023)

5
DOWLOAD Aruino IDE
RGBDuino UNO requires Arduino software to run. You can download the
software from Arduino website (http://arduino.cc/en/Main/Software) and it is
free to use.www.arduino.cc

Arduino IDE is compatible with Windows, Mac OS X and also Linux. You just
need to choose the appropriate operating system installation package for your
computer. If you are a Windows user, it is recommended that you choose
Windows (installer).

Choose the installer that compatible with your laptop OS and download the

6
Arduino IDE.
You will have arduino-1.8.x-windows.exe software after finish downloading for
Windows OS user while for Mac OS user, you will get a zip file of arduino-
1.8.x-macosx zip file as shown below :

*Note: For latest version of Arduino IDE, go to


https://www.arduino.cc/en/Main/Software

Double-click on the icon to install Arduino IDE. Complete the download,


proceed with the installation as usual. After _nish installing the software, you
can start using it by double-click on the icon. Then, you will see this layout of
Arduino IDE.

7
Label Description Label Description
A Menu Bar E Code Area
B Button Bar F Status Bar
C Serial Monitor G IDE Output
D Sketch Name H Board Name and COM
Number
8
Compiles and approves your code. It will
detect errors in syntax (e.g. missing semi
Verify colon or parentheses).

Sends your code to the Maker UNO.


When you click it, you should see the
Upload lights on your board blink rapidly.

New
This button opens up a new code window
tab.
Sketch

Open This button will let you open an existing


sketch.

Serial
This saves the currently active sketch.

Monitor

Save Open Serial Monitor.

9
Installing RGBDuino UNO driver
Download RGBDuino UNO driver at RGBDuino Uno product page (under
Attachment tab).

After installation is complete, your RGBDuino UNO port should appears at


Device Manager under Ports (COM & LPT ) - e.g. USB-SERIAL CH340
(COM3). Please remember the port number.

10
Select Board :

Select Serial Port :

11
Install NeoPixelmaster library

The library added to your libraries. Check “include library”menu

Then you can run the test code normally.

12
LESSON 1 :
THE LED (DIGITAL OUTPUT)

13
LESSON 1 :
LIGHT UP THE LED (IDE) i
LED is a light emitting diode. It will light up when a
proper voltage is applied in correct direction.

1
2 Open new sketch on Arduino IDE.

2
Write this code to your sketch:
void setup()
{ // put your setup code here, to run once:
pinMode(7, OUTPUT);
}
void loop()
{ // put your main code here, to run
repeatedly:
digitalWrite(7, HIGH);
}

14
3 Compile the file.
3 4
4
Upload the sketch.

5 You will see status of “Done Uploading”if


everything is correct your LED at pin 7 will light

The void setup() runs once when the Maker UNO is


powered on. The code in the void setup() usually use to
con_gure the pin as INPUT or OUTPUT using
pinMode();
The void loop() runs continuously after the voidsetup()
has complete. The code in the void loop() usually use to
control the INPUT and OUTPUT.The digitalWrite(); is
used to set the digital OUTPUT of the pin number to
HIGH or LOW.

15
LESSON 2:
LED (BLINKING)

16
LESSON 2 :
LIGHT UP THE LED (IDE) i
LED will blink when delay is applied between ON
and OFF. Then it will blinking!

1
2 Open new sketch on Arduino IDE.

2
Write this code to your sketch :
void setup()
{
pinMode(7, OUTPUT);
}
void loop()
{
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
delay(1000);
}

17
3 4 3 Compile the file.

4
Upload the sketch.

5 You will see status of “Done Uploading”if


everything is correct your LED at pin 7 will light

The void setup() runs once when the Maker UNO is


powered on. The code in the void setup() usually use to
c o n _ g ur e t h e pi n a s I NP UT or O UT PU T us i n g
pinMode();
The void loop() runs continuously after the voidsetup()
has complete. The code in the void loop() usually use to
control the INPUT and OUTPUT.The digitalWrite(); is
used to set the digital OUTPUT of the pin number to
HIGH or LOW.

18
LESSON 3:
FADE AN LED

19
LESSON 3 :
FADE AN LED i The LED will fade using analogWrite() function using
Pulse Width Modulation (PWM) which make a digital
output acting as analog output.

2
1
Open new sketch on Arduino IDE.

2 Write this code to your sketch :


int LED = 3;
int brightness = 0;
int fadeAmount = 5;
void setup()
{
pinMode(3, OUTPUT);
}
void loop()
{
analogWrite(LED, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 0 || brightness >= 255)
{
fadeAmount = -fadeAmount;
}
delay(30);
}

20
3 4 3 Compile the file.

4
Upload the sketch.

5 You will see status of “Done Uploading”if


everything is correct your LED at pin 7 will light

The analogWrite() function uses PWM, so if


you want to change the pin you're using, be
sure to use another PWM capable pin. On most
Arduino, the PWM pins are identi?ed with a "~" sign,
like ~3, ~5, ~6, ~9, ~10 and ~11.
The analogWrite(LED, brightness); set OUTPUT
of the pin number 3 to variable “brightness”. The LED
will light up based on the amount of variable
“brightness”.

21
LESSON 4:
PUSH BTTON (DIGITAL INPUT)

22
LESSON 4 :
PUSH BUTTON i Push button act as a digital input device. Maker UNO
is able to sense 2 states for digital input, i.e. HIGH
and LOW. Push the button and the LED will turn ON!

1
2 Open new sketch on Arduino IDE.

2
Write this code to your sketch :
int LED = 4;
int Button = 2;
void setup()
{
pinMode(4, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(Button) == LOW)
digitalWrite(LED, HIGH);
else if (digitalRead(Button) == HIGH)
digitalWrite(LED, LOW);
}

23
3 4 3 Compile the file.

4
Upload the sketch.

5 You will see status of “Done Uploading” if everything


is correct, when button is pressed, the LED pin 4 will
light up.

Using pinMode(INPUT_PULLUP), there is an


internal 20K-ohm resistor is pulled to 5V. This
con?guration causes the input to read HIGH when
the switch is open, and LOW when it is closed.
The if() statement is use to compare a condition
whether it is TRUE or FALSE.
The else if() statement is use to set other condition
than if() statement.
The digitalRead(Button) == LOW); will read the
button input. If the button is pushed, the INPUT
will be LOW.

24
LESSON 5:
MELODY DANCE

25
LESSON 5 :
MELODY DANCE

1
Go to File > Examples > RGBDuino > MelodyDance

26
2 3 2 Compile the file.

3
Upload the sketch.

4
You can change the music note based on your
preference and enjoy the music tone.

27
LESSON 6:
RGB BLINK

28
LESSON 6 :
RGB BIINK

1
Go to File > Examples > RGBDuino > RGBBLINK

29
2 3 2 Compile the file.

3
Upload the sketch.

4
You will see two RGB lights changing colors flashing

30
LESSON 7:
CONTROLLING MOTOR

31
LESSON 7 :
SCHEMATIC

32
LESSON 7 :
CONTROLLING MOTOR

1
Open new sketch on Arduino IDE.

2
2 Write this code to your sketch :
void setup()
{
pinMode(6,OUTPUT);
}
void loop()
{
analogWrite(6,255); //same with HIGH
delay(1000);
analogWrite(6,123);
delay(1000);
analogWrite(6,50);
delay(1000);
analogWrite(6, LOW);//same with 0
delay(1000);
}

33
2 3 2 Compile the file.

3
Upload the sketch.

4
The motor will rotate with 4 different speed.

34
www.RGBDuino.com
Email: 35

[email protected]

You might also like