
Automating a vintage R2D2 toy of 10cm
thingiverse
<html> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=Generator content="Microsoft Word 15 (filtered)"> </head> <body lang=ES link=blue vlink="#954F72"> <div class=WordSection1> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><b><span style='font-size:24.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>R2D2 automatizado</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><i><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Programa para dar vida a un R2D2 con sonido, luces, movimiento y melodías</span></i></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Link de YouTube con instrucciones de montaje, programación y funcionamiento : <a href="https://youtu.be/6vW1G448bJM">https://youtu.be/6vW1G448bJM</a></span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:18.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Que es...</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Mediante un procesador ATmega168 o ATmega328p podemos hacer que nuestro R2D2 hable, emita luces, gire y ande. También puede reproducir melodías pre-grabadas, y todo ello desde un mando a distancia. Una vez programado, se le pueden cambiar los códigos de los mándos y las melodias por puerto serie.</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Podemos utilizar solo el sonido y hacer una caja de música, CON o SIN luz, u otra figura que deseemos. Y prodríamos optar por ponerle solo el servo o completarlo con los dos motores.</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:18.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Instrucciones...</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Referiros al video para ver como se fabrica, pero aquí tenéis algunas nociones para programarlo por el puerto serie.</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Las instrucciones 'song' y 'end' nos permiten grabar una melodía.</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>En un ATmega328 puedes enviar los códigos de 10 en 10 (o incluso más), pero en ATmega168 de 5 en 5 por su falta de memoria dinámica.</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Este es un ejemplo, donde con 'song1' le decimos al sistema que introducimos la melodía 1 y con 'end' le comunicamos que hemos terminado.</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas; color:#24292E'>song1 T49 5R156 4D12 T0 5L1081 4D101 end </span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Las instrucciones 'altON' y 'altOFF', activan y desactivan respectivamente por el serial, los códigos RF secundarios introducidos. Ejemplo para activar:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>altON</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Y para desactivar:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>altOFF</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>La instrucción RF nos permite introducir el código del mando para hacer funcionar el R2D2 a distancia. Este ejemplo asocia el código RF XXXXXX al registro 0 (movimiento de cabeza y sonido de R2D2)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf0 XXXXXX </span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Estos son los registros disponibles:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf0 - Sonido R2D2</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf1 - Rueda Izquierda</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf2 - Rueda derecha</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf3 - Ambas ruedas</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf4 - Melodía 1</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf5 - Melodía 2</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf6 - Melodía 3</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Y para la versión de procesador ATmega 328p:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf7 – Melodía 4</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf8 – Activación/Desactivación de códigos secundarios</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf9 - Sonido R2D2 2 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf10 - Rueda Izquierda 2 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf11 - Rueda derecha 2 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf12 - Ambas ruedas 2 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf13 - Melodía 1 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf14 - Melodía 2 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf15 - Melodía 3 (código secundario)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>rf16 - Melodía 4 (código secundario)</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:18.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Como crear una melodía:</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>songX = Inicio de meloria, donde X es la melodía de 1 a 4</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>TX = Tiempo de silencio después las notas siguientes, donde X es un número de 0 a 5500 ( mS ) –redondeado-</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>XYZ = nota donde X = octava de 0 a 9, Y = letra que representa la nota según descripción abajo y Z es la duración de la nota de 1 a 4004 (mS) –redondeado-</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>end = Finalización de melodía</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Ejemplo:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas; color:#24292E'>song1 T49 5R156 4D12 T0 5L1081 4D101 end </span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:15.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Codificación de notas</span></b></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>D = Do</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>d = Do#</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>R = Re</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>r = Re#</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>M = Mi</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>F = Fa</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas; color:#24292E'>f = Fa#</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas; color:#24292E'>S = Sol</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=EN-US style='font-size:10.0pt;font-family:Consolas; color:#24292E'>s = Sol#</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>L = La</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>l = La#</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>I = Si</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:15.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Redondeo de los tempos</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Los 'tempos' de silencio serán redondeados, entre 5 y 20 mS, y los 'tempos' de las notas a estos 20 valores en mS:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>49 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>62 Semi-fusa</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>79 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>99 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>125 Fusa</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>158 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>198 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>250 Semi-corchea</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span lang=IT style='font-size:10.0pt;font-family:Consolas;color:#24292E'>315 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>397</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>500 Corchea</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>630 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>794 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>1001 Negra</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>1261 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>1589 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>2002 Blanca</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>2522 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>3178 </span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>4004 Redonda</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:15.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Que ocupa una melodía?</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>1 byte cada nota</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>2 byte por cada cambio de silencio</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>1 byte cada cambio de octava</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>1 byte al final de melodía</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:15.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Espacio en bytes para las melodías</span></b></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Lo prodrás ver en el código, y puedes cambiar la posición de inicio de los punteros de memoria, para dar más capacidad de bytes a una melodía u otra. Pero antes que grabar el programa en el ATmega, porque no es modificable por puerto serie.</span></p> <p class=MsoNormal style='margin-bottom:12.0pt;line-height:normal;background: white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif; color:#24292E'>Ejemplo del ATmega328p:</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>// 952 byte para melodias</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>const byte punteroEE_M1 = 72; // dirección melodía 1 (238 bytes)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>const int punteroEE_M2 = 310; // dirección melodía 2 (238 bytes)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>const int punteroEE_M3 = 548; // dirección melodía 3 (238 bytes)</span></p> <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><span style='font-size:10.0pt;font-family:Consolas;color:#24292E'>const int punteroEE_M4 = 786; // dirección melodía 4 (238 bytes)</span></p> <p class=MsoNormal style='margin-top:18.0pt;margin-right:0cm;margin-bottom: 12.0pt;margin-left:0cm;line-height:normal;background:white'><b><span style='font-size:15.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Disfruta...</span></b></p> <p class=MsoNormal style='line-height:normal;background:white'><span style='font-size:12.0pt;font-family:"Segoe UI",sans-serif;color:#24292E'>Oscar</span></p> <p class=MsoNormal> </p> </div> </body> </html>
With this file you will be able to print Automating a vintage R2D2 toy of 10cm with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Automating a vintage R2D2 toy of 10cm.