Pão de Queijo Development Board. This repo has all libraries from pqdb shield.

Dependents:   pqdb_demo

Pão de Queijo development board is a shield for add-on on any arduino compatible board.

/media/uploads/rmaalmeida/compatibilidade_branco.png

This project presents the libraries to control the board peripherals using mbed framework. The libraries works as interfaces to keep the main code compatible with the examples from the book "Programação de sistemas embarcados". The peripherals on the board are presented on the folowing picture

/media/uploads/rmaalmeida/pqdb_perifericos.png

The main objective of the project is to develop a low cost, easy to assemble board with a group of peripheral that allows one to start learning embedded systems. The board was routed on one side copper PCB to make easier to buid it yourself.

/media/uploads/rmaalmeida/pqdb_fenolite_-_cortada.png

The source code for Arduino boards (wiring) can be found on: https://github.com/projetopqdb/PQDB-Arduino

The source code for freedom frdm KL05 board (using direct register access) can be found on: https://github.com/projetopqdb/PQDB-KL05Z

The source code from the board schematics and layout can be found on: https://github.com/projetopqdb/PQDB-Hardware

Committer:
rmaalmeida
Date:
Tue Oct 03 01:27:24 2017 +0000
Revision:
6:3fb450ba1e95
Parent:
1:083267bc0a0e
timer driver added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rmaalmeida 0:32fded6e1775 1 //#include "io.h"
rmaalmeida 1:083267bc0a0e 2 #include "mbed.h"
rmaalmeida 0:32fded6e1775 3
rmaalmeida 0:32fded6e1775 4 DigitalOut LED_R_PIN(D4);
rmaalmeida 0:32fded6e1775 5 DigitalOut LED_G_PIN(D3);
rmaalmeida 0:32fded6e1775 6 DigitalOut LED_B_PIN(D2);
rmaalmeida 0:32fded6e1775 7
rmaalmeida 0:32fded6e1775 8 void rgbColor(int led) {
rmaalmeida 0:32fded6e1775 9 if (led & 1) {
rmaalmeida 0:32fded6e1775 10 LED_R_PIN=1;
rmaalmeida 0:32fded6e1775 11 // digitalWrite(LED_R_PIN, HIGH);
rmaalmeida 0:32fded6e1775 12 } else {
rmaalmeida 1:083267bc0a0e 13 LED_R_PIN=0;
rmaalmeida 0:32fded6e1775 14 //digitalWrite(LED_R_PIN, LOW);
rmaalmeida 0:32fded6e1775 15 }
rmaalmeida 0:32fded6e1775 16 if (led & 2) {
rmaalmeida 0:32fded6e1775 17 LED_G_PIN = 1;
rmaalmeida 0:32fded6e1775 18 // digitalWrite(LED_G_PIN, HIGH);
rmaalmeida 0:32fded6e1775 19 } else {
rmaalmeida 0:32fded6e1775 20 LED_G_PIN = 0;
rmaalmeida 0:32fded6e1775 21 // digitalWrite(LED_G_PIN, LOW);
rmaalmeida 0:32fded6e1775 22 }
rmaalmeida 0:32fded6e1775 23 if (led & 4) {
rmaalmeida 0:32fded6e1775 24 LED_B_PIN = 1;
rmaalmeida 0:32fded6e1775 25 // digitalWrite(LED_B_PIN, HIGH);
rmaalmeida 0:32fded6e1775 26 } else {
rmaalmeida 0:32fded6e1775 27 LED_B_PIN = 0;
rmaalmeida 0:32fded6e1775 28 // digitalWrite(LED_B_PIN, LOW);
rmaalmeida 0:32fded6e1775 29 }
rmaalmeida 0:32fded6e1775 30 }
rmaalmeida 0:32fded6e1775 31
rmaalmeida 0:32fded6e1775 32 void turnOn(int led) {
rmaalmeida 0:32fded6e1775 33 if (led & 1) {
rmaalmeida 0:32fded6e1775 34 LED_R_PIN =1;
rmaalmeida 0:32fded6e1775 35 // digitalWrite(LED_R_PIN, HIGH);
rmaalmeida 0:32fded6e1775 36 }
rmaalmeida 0:32fded6e1775 37 if (led & 2) {
rmaalmeida 0:32fded6e1775 38 LED_G_PIN = 1;
rmaalmeida 0:32fded6e1775 39 // digitalWrite(LED_G_PIN, HIGH);
rmaalmeida 0:32fded6e1775 40 }
rmaalmeida 0:32fded6e1775 41 if (led & 4) {
rmaalmeida 0:32fded6e1775 42 LED_B_PIN = 1;
rmaalmeida 0:32fded6e1775 43 //digitalWrite(LED_B_PIN, HIGH);
rmaalmeida 0:32fded6e1775 44 }
rmaalmeida 0:32fded6e1775 45 }
rmaalmeida 0:32fded6e1775 46
rmaalmeida 0:32fded6e1775 47 void turnOff(int led) {
rmaalmeida 0:32fded6e1775 48 if (led & 1) {
rmaalmeida 0:32fded6e1775 49 LED_R_PIN =0;
rmaalmeida 0:32fded6e1775 50 // digitalWrite(LED_R_PIN, LOW);
rmaalmeida 0:32fded6e1775 51 }
rmaalmeida 0:32fded6e1775 52 if (led & 2) {
rmaalmeida 0:32fded6e1775 53 LED_G_PIN = 0;
rmaalmeida 0:32fded6e1775 54 // digitalWrite(LED_G_PIN, LOW);
rmaalmeida 0:32fded6e1775 55 }
rmaalmeida 0:32fded6e1775 56 if (led & 4) {
rmaalmeida 0:32fded6e1775 57 LED_B_PIN = 0;
rmaalmeida 0:32fded6e1775 58 // digitalWrite(LED_B_PIN, LOW);
rmaalmeida 0:32fded6e1775 59 }
rmaalmeida 0:32fded6e1775 60 }
rmaalmeida 0:32fded6e1775 61
rmaalmeida 0:32fded6e1775 62 void rgbInit(void) {
rmaalmeida 0:32fded6e1775 63 // pinMode(LED_R_PIN, OUTPUT);
rmaalmeida 0:32fded6e1775 64 //pinMode(LED_G_PIN, OUTPUT);
rmaalmeida 0:32fded6e1775 65 /// pinMode(LED_B_PIN, OUTPUT);
rmaalmeida 0:32fded6e1775 66 }