5043

Make a "moo" box 1 ATtiny85 1 tilt switch or ball tilt 1 HP 8 ohms 1 Battery (recovery) 1 charger 3.7V HW373 battery // FR Fabriquer une boite à "mheu" :) 1 ATtiny85 1 tilt switch ou ball tilt 1 HP 8 ohms 1 Accu (de récupération) 1 charger accu 3.7V HW373

For those who follow, and others, I promised Paolina that we would do something other than a bracelet of the rest of the tube of salt which was used in the crank box. But what to do with it ??a tactile Simon? a game of whack-a-mole?a “moo” box...? LOL!A “moo” box!
Okay, let's see that. An ATtiny85, to stay with the piano or box crank idea, which must be able to read a file in Hex format, restore it through an HP and generate a "moo". 
By searching this very good site: http://www.technoblogy.com/show?QBBI found what I was looking for there, I downloaded the example code and a duck sound was generated by the U.C.
I started looking for a sound suited to the project, a “cow moo” and I found a moo box sound here: https://lasonotheque.org/search?q=meuh
You will find something to replace the "moo" with a sound you like, which you will need to convert... ...
The repetitions of "moo" from the found footage, were not suitable for the project, as only one sequence was needed.  
The file was opened using Audacity, then cut to retain only one "moo". The recording was made in 8-bit wav format.
https://www.audacityteam.org/  
The extraction of the table of raw audio data, which will inform the song to be played in the code, was carried out using HxD.
https://mh-nexus.de/en/hxd/  
The format of the values from HDX is not suitable for the code, you must insert 0x and commas in the resulting table. Once this tedious task was completed, I had to review the size of the piece (remove as much of the tape without sound as possible, cut the end of the piece as short as possible, delete the last data, etc.) 
Several wav file manipulations and test code uploads, facilitated by EasyTinyProg, were carried out until a more than adequate sound result was obtained by maximizing the capabilities of the ATtiny85. 
The sketch uses 8104 bytes (98%) of program storage space. The maximum is 8192 bytes. You barely have any space left ! 
The code reads the array through a loop which is associated with the size of the array (n boxes) 
To determine the size of the array to read (7677 for one mheu) and enter this value in the "mheu" box code, I used an Arduino UNO, the sketch below and the serial port. 
You will find the sketch under the name: Taille_table_mheu.ino 
The complets explanations of the moo box code, in the code :) ATTINY_MHEU_WAV.ino 
The realization should not pose any particular problem for you. 
For my part, I recovered the remaining piece of tube from the proto crank box the "ball tilt" in an xbox intended for recycling the hp in the hp box from dismantling the battery comes from an old laptop battery
I mounted the motherboard vertically with a hot glue gun (the ball is in the bottom position, opposite the contact, which is at the top. when the box is overturned, the ball makes a closed contact which is connected between the CPU reset pin and ground. 
By repositioning the box, the ball falls and opens the reset contact, the object restarts, the box emits a "moo" (that was the goal) and the object goes back to sleep to manage the battery, or, come on, let'sstart again ! 
The battery, the charger, identical to the crank box.The assembly is powered by 3v7, accepts 5V. You can change the sound as you wish.Enjoy! "mheu"! Bruno Clerc From FranceListen here:
https://youtube.com/shorts/DO0_t3U06aI
// FR
Pour ceux qui suivent, et les autres, j'ai promis à Paolina que l'on ferait autre chose qu'un bracelet du reste du tube de sel qui à servi à la boite à manivelle. Mais qu'en faire ?? un Simon tactile ? un jeux de taupe ? une boite à "mheu" ...? LOL ! Une boite à "mheu"  ! 
Ok, voyons voir cela. Un ATtiny85, pour rester dans l'idée piano ou boite à manivelle, qui doit pouvoir lire un fichier au format Hex, le restituer au travers un HP et générer un " mheu".
En recherchant sur ce très bon site :  http://www.technoblogy.com/show?QBB j'y ai trouvé mon bonheur, j'ai téleversé le code exemple et un son de canard à été généré par l'U.C.
Je me suis mis en recherche d'un son adapté au projet, un "mheu de vache" et j'ai trouvé un son de boite à mheu ici : https://lasonotheque.org/search?q=meuh
Vous y trouverez de quoi remplacer le "mheu" par un son à votre convenance, qu'il vous faudra convertir... Les répétitions de "mheu" de la séquence trouvée ne convenaient pas au projet, car une seule séquence était nécessaire. Le fichier a été ouvert à l'aide d'Audacity, puis recoupé pour ne retenir qu'un seul "mheu". L'enregistrement à été fait au format wav 8 bits. 
https://www.audacityteam.org/ 
L'extraction de la table des données audio brutes, qui renseigneront le morceau à jouer dans le code, a été réalisé à l'aide de HxD.
https://mh-nexus.de/en/hxd/
Le format des valeurs issue de HDX ne conviennent pas au code, il faut insérer les 0x et les virgules sur la table obtenue. Une fois cette tache fastidieuse réalisée, il m'a fallu revoir la taille du morceau (ôtez un maximum de la bande sans son, couper au plus court la fin du morceau, supprimer les dernières données...)
Plusieurs manipulations de fichier wav et téléversements de codes de tests, facilité par EasyTinyProg, ont été réalisé jusqu'à l'obtention d'un résultat sonore plus que convenable en exploitant au maximum les capacités de l'ATtiny85.
Le croquis utilise 8104 octets (98%) de l'espace de stockage de programmes. Le maximum est de 8192 octets. Vous n'avez plus guère de place  !
Le code lit le tableau par une boucle qui est associée à la taille du tableau (n cases) Pour déterminer la taille du tableau à lire (7677 pour un "mheu") et renseigner cette valeur dans le code boite à "mheu",  j'ai utilisé un Arduino UNO, le sketch ci-après et le port série. Vous trouverez le sketch sous le nom : Taille_tableau_mheu.ino 
Les explications complètes du code boite à "mheu", dans le code boite à "mheu"  :) ATTINY_MHEU_WAV.ino 
La réalisation ne devrait pas vous poser de problème particulier.  
De mon coté, j'ai récupéré le bout de tube restant du proto boite à manivelle, le "ball tilt" dans une xbox destiné au recyclage, le hp dans la boite à hp issus de démontage, l'accu est issu d'une ancienne batterie de pc portable.
J'ai monté au pistolet à colle chaude la carte mère verticalement (la bille est en position basse, à l'opposé du contact, qui lui se trouve en haut. lorsque l'on renverse la boite, la bille réalise un contact fermé qui est connecté entre la pin reset de l'UC et la masse.
En repositionnant la boite, la bille retombe et ouvre le contact reset, l'objet redémarre, la boite émet un "mheu" (c'était le but) et l'objet se rendort pour gérer la pile, ou bien, allez, on recommence ! 
L'accu, le chargeur, identique à la boîte à manivelle. Le montage est alimenté en 3v7, accepte 5V.Vous pouvez changer de son à votre convenance.
écouter ici  https://youtube.com/shorts/DO0_t3U06aI 
Enjoy !Mheu !
Bruno Clerc