3532
Comentario:
|
4693
|
Los textos eliminados se marcan así. | Los textos añadidos se marcan así. |
Línea 13: | Línea 13: |
En esta actividad, se plantea el uso de la librería de arduino LCD, en una primera aproximación se plantea el uso de pantalla LCD, donde se visualice un contador que se reinicie cada 100 iteraciones, para luego realizar otras actividades, <<BR>><<BR>> === Manejo de LCD === ==== ==== <<BR>><<BR>> === Manejo de arreglo de siete segmentos === {{attachment:hl-bcd.png}} |
|
Línea 16: | Línea 27: |
HOLA Ing. Alberto Medrano */ |
* Print "HOLA" into 7 segment array display * * (c) 2010 Alberto Medrano (alberto@cenditel.gob.ve) * CENDITEL Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
Línea 55: | Línea 81: |
val = analogRead(potPin); // read the value from the sensor digitalWrite(bcd_A, LOW); // H |
val = analogRead(potPin); // read the value from potentiometer digitalWrite(bcd_A, LOW); // H |
Línea 67: | Línea 93: |
val = analogRead(potPin); // read the value from the sensor | val = analogRead(potPin); // read the value from potentiometer |
Línea 79: | Línea 105: |
val = analogRead(potPin); // read the value from the sensor | val = analogRead(potPin); // read the value from potentiometer |
Línea 91: | Línea 117: |
val = analogRead(potPin); // read the value from the sensor | val = analogRead(potPin); // read the value from potentiometer |
Curso Sensibilización Hardware Libre (Unidad 002)
Tabla de Contenidos
002/04 Actividad 004
En esta actividad, se plantea el uso de la librería de arduino LCD, en una primera aproximación se plantea el uso de pantalla LCD, donde se visualice un contador que se reinicie cada 100 iteraciones, para luego realizar otras actividades,
Manejo de LCD
Manejo de arreglo de siete segmentos
/* * Print "HOLA" into 7 segment array display * * (c) 2010 Alberto Medrano (alberto@cenditel.gob.ve) * CENDITEL Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ int potPin = 0; // select the input pin for the potentiometer int val = 0; int common_0 = 12; int common_1 = 11; int common_2 = 10; int common_3 = 9; int bcd_A = 8; int bcd_B = 7; int bcd_C = 6; int bcd_D = 5; int bcd_E = 4; int bcd_F = 3; int bcd_G = 2; void setup() { pinMode(common_0, OUTPUT); // Declarando Salidas pinMode(common_1, OUTPUT); // Declarando Salidas pinMode(common_2, OUTPUT); // Declarando Salidas pinMode(common_3, OUTPUT); // Declarando Salidas pinMode(bcd_A, OUTPUT); // Declarando Salidas pinMode(bcd_B, OUTPUT); // Declarando Salidas pinMode(bcd_C, OUTPUT); // Declarando Salidas pinMode(bcd_D, OUTPUT); // Declarando Salidas pinMode(bcd_E, OUTPUT); // Declarando Salidas pinMode(bcd_F, OUTPUT); // Declarando Salidas pinMode(bcd_G, OUTPUT); // Declarando Salidas digitalWrite(common_0, LOW); digitalWrite(common_1, LOW); digitalWrite(common_2, LOW); digitalWrite(common_3, LOW); } void loop() { val = analogRead(potPin); // read the value from potentiometer digitalWrite(bcd_A, LOW); // H digitalWrite(bcd_B, HIGH); digitalWrite(bcd_C, HIGH); digitalWrite(bcd_D, LOW); digitalWrite(bcd_E, HIGH); digitalWrite(bcd_F, HIGH); digitalWrite(bcd_G, HIGH); digitalWrite(common_0, HIGH); delay(val); digitalWrite(common_0, LOW); val = analogRead(potPin); // read the value from potentiometer digitalWrite(bcd_A, HIGH); // O digitalWrite(bcd_B, HIGH); digitalWrite(bcd_C, HIGH); digitalWrite(bcd_D, HIGH); digitalWrite(bcd_E, HIGH); digitalWrite(bcd_F, HIGH); digitalWrite(bcd_G, LOW); digitalWrite(common_1, HIGH); delay(val); digitalWrite(common_1, LOW); val = analogRead(potPin); // read the value from potentiometer digitalWrite(bcd_A, LOW); // L digitalWrite(bcd_B, LOW); digitalWrite(bcd_C, LOW); digitalWrite(bcd_D, HIGH); digitalWrite(bcd_E, HIGH); digitalWrite(bcd_F, HIGH); digitalWrite(bcd_G, LOW); digitalWrite(common_2, HIGH); delay(val); digitalWrite(common_2, LOW); val = analogRead(potPin); // read the value from potentiometer digitalWrite(bcd_A, HIGH); // A digitalWrite(bcd_B, HIGH); digitalWrite(bcd_C, HIGH); digitalWrite(bcd_D, LOW); digitalWrite(bcd_E, HIGH); digitalWrite(bcd_F, HIGH); digitalWrite(bcd_G, HIGH); digitalWrite(common_3, HIGH); delay(val); digitalWrite(common_3, LOW); }