Skip to content

Commit c5093ad

Browse files
authored
Merge pull request #26 from Arduino-DMX-512-Tester-and-Controller/v1.4
V1.4
2 parents b33e246 + b9ceef8 commit c5093ad

7 files changed

+1871
-1542
lines changed

DMX_Controller/DMX_Controller.cpp.elf

5.12 KB
Binary file not shown.

DMX_Controller/DMX_Controller.cpp.hex

Lines changed: 1637 additions & 1516 deletions
Large diffs are not rendered by default.

DMX_Controller/DMX_Controller.ino

Lines changed: 222 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// ** **
44
// ** Arduino DMX-512 Tester Controller **
55
// ** **
6-
// ** - Firmware v1.3 **
7-
// ** - Hardware v0.4 **
6+
// ** - Firmware v1.4 **
7+
// ** - Hardware v0.4 **
88
// ** **
99
// ** - Compilado en Arduino IDE v1.0.6 **
1010
// ** - Editado en Note++ **
@@ -405,7 +405,7 @@ void GUI_Licence()
405405
void GUI_About()
406406
{
407407
byte Firm_Ver_Ent = 1;
408-
byte Firm_Ver_Dec = 3;
408+
byte Firm_Ver_Dec = 4;
409409
byte Hard_Ver_Ent = 0;
410410
byte Hard_Ver_Dec = 4;
411411
byte Key_Light_Value = EEPROM.read(Key_Light_Add);
@@ -539,7 +539,7 @@ void GUI_Control_Matrix()
539539
inicio:
540540
lcd.clear();
541541
lcd.setCursor (0, 0);
542-
lcd.print("c--- Mb Ctr -");
542+
lcd.print("c--- Mb Exi -");
543543
lcd.setCursor (7, 0);
544544
if (Universo_Actual == 0)
545545
{
@@ -1359,7 +1359,7 @@ void GUI_Control_Secuencer()
13591359
lcd.setCursor (4, 1);
13601360
lcd.print("Delay 001x100=mS");
13611361
lcd.setCursor (0, 2);
1362-
lcd.print("FirstBank 001 Ctrl");
1362+
lcd.print("FirstBank 001 Exit");
13631363
lcd.setCursor (0, 3);
13641364
lcd.print("FinalBank 008 Start");
13651365
// Cursor
@@ -2005,8 +2005,8 @@ void GUI_Control_Options()
20052005
inicio:
20062006
// LCD
20072007
lcd.clear ();
2008-
lcd.setCursor (0, 0);
2009-
lcd.print ("Control: b");
2008+
lcd.setCursor (18, 0);
2009+
lcd.print ("b");
20102010
if (Universo_Actual == 0)
20112011
{
20122012
lcd.print ("-");
@@ -2015,6 +2015,8 @@ void GUI_Control_Options()
20152015
{
20162016
lcd.print (Universo_Actual);
20172017
}
2018+
lcd.setCursor (2, 0);
2019+
lcd.print ("Convert");
20182020
lcd.setCursor (2, 1);
20192021
lcd.print ("Unitary");
20202022
lcd.setCursor (2, 2);
@@ -2042,6 +2044,7 @@ void GUI_Control_Options()
20422044
Cursor_Conf[0][10] = 1; // Config
20432045
Cursor_Conf[2][10] = 1; // Secuencer
20442046
Cursor_Conf[1][10] = 1; // Memory
2047+
Cursor_Conf[0][1] = 1; // Convert
20452048
// navegar
20462049
GUI_Navegar(0, 0);
20472050
// Acciones
@@ -2075,6 +2078,11 @@ void GUI_Control_Options()
20752078
{
20762079
GUI_Control_Secuencer();
20772080
}
2081+
// Converter
2082+
if (LCD_Col_Pos == 1 && LCD_Row_Pos == 0)
2083+
{
2084+
GUI_Convert();
2085+
}
20782086
// Memory
20792087
if (LCD_Col_Pos == 10 && LCD_Row_Pos == 1)
20802088
{
@@ -2083,6 +2091,207 @@ void GUI_Control_Options()
20832091
}
20842092
}
20852093

2094+
void GUI_Convert()
2095+
{
2096+
int valor = 0; // aqui el valor a calcular
2097+
int valor_temp = 0; // aqui el valor temporal para las cuentas
2098+
int valor_resto = 0; // aqui el valor del resto de la divicion
2099+
int valor_Bin [10] = {0,0,0,0,0,0,0,0,0,0}; // aqui el valor descompuesto en binario
2100+
lcd.clear ();
2101+
lcd.setCursor (0, 0);
2102+
lcd.print ("Bin: OOOOOOOOO I=On");
2103+
lcd.setCursor (5, 1);
2104+
lcd.print ("124813612 O=Off");
2105+
lcd.setCursor (9, 2);
2106+
lcd.print ("62425");
2107+
lcd.setCursor (0, 3);
2108+
lcd.print ("Dec: 000 86 Exit");
2109+
// Cursor
2110+
LCD_Col_Pos = 4; // posicion de cursor
2111+
LCD_Row_Pos = 3; // posicion e cursor
2112+
// configuracion de cursor
2113+
Cursor_Conf_Clear(); // limpiar array
2114+
// Cursores
2115+
Cursor_Conf[0][4] = 1; // Bin
2116+
Cursor_Conf[3][4] = 1; // Dec
2117+
Cursor_Conf[3][15] = 1; // Exit
2118+
//Navegacion:
2119+
calc:
2120+
GUI_Navegar(0, 0);
2121+
// Acciones
2122+
// Exit
2123+
if (LCD_Col_Pos == 15 && LCD_Row_Pos == 3)
2124+
{
2125+
GUI_Control_Options();
2126+
}
2127+
// Binario a decimal
2128+
if (LCD_Col_Pos == 4 && LCD_Row_Pos == 0)
2129+
{
2130+
// boton de centro para salir
2131+
// boton de lados para navegar
2132+
// boton arriba abajo para cambiar valor
2133+
byte cursor = 5; // posicion de cursor
2134+
int boton_retardo = 250; // retardo de boton para estabilidad
2135+
byte calcular = 0; // calcular binario a decimal
2136+
byte calcular_val = 0; // valor a meter a la matriz para calcular
2137+
lcd.blink();
2138+
lcd.setCursor (5, 0);
2139+
while (digitalRead(Boton_Center) == HIGH) // salida
2140+
{
2141+
if (digitalRead(Boton_Right) == LOW)
2142+
{
2143+
delay(boton_retardo); // esperar a estabilidad
2144+
cursor = cursor + 1;
2145+
if (cursor > 13)
2146+
{
2147+
cursor = 5; // regresar al principio
2148+
}
2149+
lcd.setCursor (cursor, 0);
2150+
}
2151+
if (digitalRead(Boton_Left) == LOW)
2152+
{
2153+
delay(boton_retardo); // esperar a estabilidad
2154+
cursor = cursor - 1;
2155+
if (cursor < 5)
2156+
{
2157+
cursor = 13; // regresar al final
2158+
}
2159+
lcd.setCursor (cursor, 0);
2160+
}
2161+
if (digitalRead(Boton_Up) == LOW)
2162+
{
2163+
delay(boton_retardo); // esperar a estabilidad
2164+
lcd.print ("I");
2165+
lcd.setCursor (cursor, 0);
2166+
calcular_val = 1;
2167+
calcular = 1;
2168+
}
2169+
if (digitalRead(Boton_Down) == LOW)
2170+
{
2171+
delay(boton_retardo); // esperar a estabilidad
2172+
lcd.print ("O");
2173+
lcd.setCursor (cursor, 0);
2174+
calcular_val = 0;
2175+
calcular = 1;
2176+
}
2177+
if (calcular == 1)
2178+
{
2179+
calcular = 0;
2180+
// agregar a la matriz el valor nuevo
2181+
switch (cursor)
2182+
{
2183+
case 5: // 1
2184+
valor_Bin [1] = calcular_val;
2185+
break;
2186+
case 6: // 2
2187+
valor_Bin [2] = calcular_val;
2188+
break;
2189+
case 7: // 4
2190+
valor_Bin [3] = calcular_val;
2191+
break;
2192+
case 8: // 8
2193+
valor_Bin [4] = calcular_val;
2194+
break;
2195+
case 9: // 16
2196+
valor_Bin [5] = calcular_val;
2197+
break;
2198+
case 10: // 32
2199+
valor_Bin [6] = calcular_val;
2200+
break;
2201+
case 11: // 64
2202+
valor_Bin [7] = calcular_val;
2203+
break;
2204+
case 12: // 128
2205+
valor_Bin [8] = calcular_val;
2206+
break;
2207+
case 13: // 256
2208+
valor_Bin [9] = calcular_val;
2209+
break;
2210+
}
2211+
// calcular valor de binario a decimal
2212+
valor = 0;
2213+
if (valor_Bin [1] == 1)
2214+
{
2215+
valor = valor + 1;
2216+
}
2217+
if (valor_Bin [2] == 1)
2218+
{
2219+
valor = valor + 2;
2220+
}
2221+
if (valor_Bin [3] == 1)
2222+
{
2223+
valor = valor + 4;
2224+
}
2225+
if (valor_Bin [4] == 1)
2226+
{
2227+
valor = valor + 8;
2228+
}
2229+
if (valor_Bin [5] == 1)
2230+
{
2231+
valor = valor + 16;
2232+
}
2233+
if (valor_Bin [6] == 1)
2234+
{
2235+
valor = valor + 32;
2236+
}
2237+
if (valor_Bin [7] == 1)
2238+
{
2239+
valor = valor + 64;
2240+
}
2241+
if (valor_Bin [8] == 1)
2242+
{
2243+
valor = valor + 128;
2244+
}
2245+
if (valor_Bin [9] == 1)
2246+
{
2247+
valor = valor + 256;
2248+
}
2249+
// escribir el valor en decimal
2250+
Numerico_Write (valor, 5, 3);
2251+
lcd.setCursor (cursor, 0);
2252+
}
2253+
}
2254+
delay(200); // esperar a estabilidad
2255+
lcd.noBlink();
2256+
goto calc;
2257+
}
2258+
// Decimal a binario
2259+
if (LCD_Col_Pos == 4 && LCD_Row_Pos == 3)
2260+
{
2261+
Num_Row_Pos = 3;
2262+
Num_Col_Pos = 5;
2263+
Numerico_Calc (0);
2264+
if (Num_Val > 511)
2265+
{
2266+
Num_Val = 511; // corregir valor en pantalla
2267+
lcd.setCursor (5, 3);
2268+
lcd.print ("511");
2269+
}
2270+
valor = Num_Val;
2271+
// escribir 00000000 en el valor binario para borrar el anterior
2272+
lcd.setCursor (5, 0);
2273+
lcd.print ("OOOOOOOOO");
2274+
lcd.setCursor (5, 0);
2275+
// calcular binario
2276+
valor_temp = valor;
2277+
for (byte pos = 9; pos >= 1; pos --)
2278+
{
2279+
valor_resto = valor_temp % 2;
2280+
valor_temp = valor_temp / 2;
2281+
valor_Bin [pos] = valor_resto;
2282+
if (valor_resto == 0)
2283+
{
2284+
lcd.print ("O");
2285+
}
2286+
else
2287+
{
2288+
lcd.print ("I");
2289+
}
2290+
}
2291+
goto calc;
2292+
}
2293+
}
2294+
20862295
void GUI_Config()
20872296
{
20882297
Inicio:
@@ -2119,7 +2328,7 @@ void GUI_Config()
21192328
}
21202329
// Cursor
21212330
LCD_Col_Pos = 10; // posicion de cursor
2122-
LCD_Row_Pos = 1; // posicion e cursor
2331+
LCD_Row_Pos = 1; // posicion de cursor
21232332
// configuracion de cursor
21242333
Cursor_Conf_Clear(); // limpiar array
21252334
// Cursores
@@ -2323,7 +2532,7 @@ void GUI_Control_Multiply()
23232532
lcd.print(Universo_Actual);
23242533
}
23252534
lcd.setCursor (0, 1);
2326-
lcd.print ("First CH Ctrl");
2535+
lcd.print ("First CH Exit");
23272536
lcd.setCursor (0, 2);
23282537
lcd.print ("Multiply Memory");
23292538
lcd.setCursor (0, 3);
@@ -2349,7 +2558,7 @@ void GUI_Control_Multiply()
23492558
// navegar
23502559
GUI_Navegar(0, 0);
23512560
// Acciones
2352-
// Control
2561+
// Exit
23532562
if (LCD_Col_Pos == 13 && LCD_Row_Pos == 1)
23542563
{
23552564
GUI_Control_Options();
@@ -2490,7 +2699,7 @@ void GUI_Control_Chaser()
24902699
lcd.setCursor (3, 1);
24912700
lcd.print ("Delay x10=mS");
24922701
lcd.setCursor (0, 2);
2493-
lcd.print ("First CH Ctrl");
2702+
lcd.print ("First CH Exit");
24942703
lcd.setCursor (0, 3);
24952704
lcd.print ("Final CH Start");
24962705
Numerico_Write (Delay, 9, 1);
@@ -2621,7 +2830,7 @@ void GUI_Control_Chaser()
26212830

26222831
void Numerico_Write (int valor, int col, int row)
26232832
{
2624-
//posicionar el valor en los campos 000
2833+
// posicionar el valor en los campos 000
26252834
lcd.setCursor (col, row);
26262835
lcd.print ("000");
26272836
if (valor < 10)
@@ -2656,7 +2865,7 @@ void GUI_Control_Unit()
26562865
lcd.print(Universo_Actual);
26572866
}
26582867
lcd.setCursor (14, 2);
2659-
lcd.print ("Ctrl");
2868+
lcd.print ("Exit");
26602869
lcd.setCursor (14, 3);
26612870
lcd.print ("Memory");
26622871
lcd.setCursor (0, 2);

LCD - EEPROM - Layout.xlsx

503 Bytes
Binary file not shown.

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## **Firmware - LCD 20x4**
44

5-
[![version](https://img.shields.io/badge/version-1.3_release-brightgreen.svg)](CHANGELOG.md)
5+
[![version](https://img.shields.io/badge/version-1.4_release-brightgreen.svg)](CHANGELOG.md)
66
[![license](https://img.shields.io/badge/licence-GNU_GPL_v3.0-blue)](https://github.com/Arduino-DMX-512-Tester-and-Controller/Arduino-DMX-512-Tester-and-Controller-LCD-20x4-Firmware/blob/master/LICENCE.md)
77

88
![GitHub issues](https://img.shields.io/github/issues/Arduino-DMX-512-Tester-and-Controller/Arduino-DMX-512-Tester-and-Controller-LCD-20x4-Firmware)
@@ -90,18 +90,17 @@ Herramienta Open Hardware, para pruebas y control de iluminación de espectácul
9090

9191
### ![**Changelog**](CHANGELOG.md)
9292

93-
- **CORREGIR,** en control matrix cuando se selecciona un canal de la esquina el cursor parpadeando queda fuera de lugar
94-
- **AGREGADO,** Control de iluminación para teclado
95-
- **AGREGADO,** a EEPROM la posición 4092 para guardar key light
96-
- **AGREGADO,** la variable global int EEPROM_Limit para controlar el límite de escritura de eeprom de universos
97-
- **AGREGADO,** EEPROM_Limit a todas las funciones de memoria EEPROM
98-
- **AGREGADO,** el control * en el teclado controla el back light y el key light
99-
- **AGREGADO,** variable global Light_On_Off para control desde tecla * de la iluminacion de teclado y back
100-
- **AGREGADO,** al about un dimmer en key y back durante el efecto binario
101-
- **AGREGADO,** a la tecla de light * un dimmer de on y off para key y back
102-
- **CORREGIDO,** en Back_Light_En, byte Back_Light_Value = EEPROM.read(513); el valor esta fuera de rango
103-
- **CORREGIDO,** unused variable 'EEPROM_Add'
104-
- **CORREGIDO,** en about "open hardware!" por "Open Source License:"
93+
- **CORREGIDO,** en about la versión actual
94+
- **CORREGIDO,** las leyendas Ctrl cambian por Exit, el menú control ya no tiene la leyenda
95+
- **CORREGIDO,** en control unitary Ctrl cambia por Exit
96+
- **CORREGIDO,** en control Matrix Ctr cambia por Exi
97+
- **CORREGIDO,** en control chaser Ctrl por Exit
98+
- **CORREGIDO,** en control secuencer Ctrl por Exit
99+
- **CORREGIDO,** en control multiply Ctrl por Exit
100+
- **CORREGIDO,** en control options se quitó la leyenda Control:
101+
- **AGREGADO,** Convert, convierte entre binario y decimal para address dip switch
102+
- **AGREGADO,** a control options la opción Convert
103+
- **AGREGADO,** a Convert binario a decimal botón de centro para salir, botón de lados para navegar, botón arriba abajo para cambiar valor
105104

106105
***
107106

media/IMG_0067.JPG

83.3 KB
Loading

media/IMG_0068.JPG

72.4 KB
Loading

0 commit comments

Comments
 (0)