Rob's web

Multi function shield

Home - Techniek - Computer - Arduino microcontroler - Uno - Multi functional shield


mfs

Warning

Alvorens de mfs op de uno te plaatsen eerst de pinnen van het display zo kort mogelijk afknippen en isolatie over de usb connector plakken i.v.m. mogelijke kortsluiting.

Kenmerken

Led display

LED display
Schema display module.

Aansturing
PinFunctionDiscription 
4LCHCLKLatch clockactive low
7SFTCLKShift clockactive low
8SDISerial data in 

Display aansturing

SMD leds

LED gaat branden als de poort laag wordt.

Leds

Trimpotentiometer

De loper van de potmeter geeft een spanning tussen 0 en 5 V aan A0.

Potmeter

Drukknoppen

De drukknopen S1, S2, S3 zetten 0 V op resp. A1, A2 of A3. In rust is dit 5 V.

Drukknoppen

Piëzo zoemer

De zoemer gaat aan als 3 laag wordt.

zoemer

IR ontvangerinterface U4

IR ontvangerchip

DS18B20 en LM35 interface U5

temp interface

ds18b20lm35

Sensor en actuator interface

Voor sensor en actuator gebruik zijn de poorten 5, 6, 9 en A5 beschikbaar. De sensoren en actuators worden vanaf hier gevoed met 5 V.

Sensor interface

Seriële interface

apc220

Programming

Let's define the board to make it easier to program

One of the convenient features of programming in Arduino is that you can define names to represent the Arduino pins. As you program, it is easy to remember that BUZZER is the pin that the buzzer is connected to. We will use a name for each of the features so we can make our code easier to read and write. Here is how we do that:

#define LED_1 13 // LED pins
#define LED_2 12
#define LED_3 11
#define LED_4 10
#define BUZZER 3 // The buzzer
#define POTMETER A0 // The analog input for the potentiometer
#define BUTTON_1 A1 // The input pushbuttons
#define BUTTON_2 A2
#define BUTTON_3 A3
#define DISP_LATCH 4 // The 3 pins that control the display
#define DISP_CLK 7
#define DISP_DATA 8

If you insert these #define statements in the beginning of your Arduino code, you will now be able to refer to the features by their name instead of their pin number.

The next thing you usually want to do is set up the pinMode for each of these features. If you are a veteran Arduino programmer, you will have noticed that most libraries will do this for pins the library is going to use. However, it is good practice to ensure the pins are setup to your liking. In your setup() procedure you would want the following pinMode() commands:

First, set the LED pins as outputs:

pinMode(LED_1, OUTPUT);
pinMode(LED_2, OUTPUT);
pinMode(LED_3, OUTPUT);
pinMode(LED_4, OUTPUT);

Write this pins high so they will turn off the LEDs:

digitalWrite(LED_1, HIGH);
digitalWrite(LED_2, HIGH);
digitalWrite(LED_3, HIGH);
digitalWrite(LED_4, HIGH);

Next, set the pushbuttons as inputs (there are pullup resistors on the board so there is no need for the internal pullups).

pinMode(BUTTON_1, INPUT);
pinMode(BUTTON_2, INPUT);
pinMode(BUTTON_3, INPUT);

Set the buzzer as an output:

pinMode(BUZZER, OUTPUT);

And turn it off:

digitalWrite(BUZZER, HIGH);

Finally, define the display pins as outputs:

pinMode(DISP_LATCH, OUTPUT);
pinMode(DISP_CLK, OUTPUT);
pinMode(DISP_DATA, OUTPUT);

That finishes our setup for using the board.

DHT11 - LM35 multi function shield

DHT11 LM35 mfs

Docs