howto:thymio:thymio_barcode_reader

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
howto:thymio:thymio_barcode_reader [2023/06/27 15:55] – [How to use the code] mariehowto:thymio:thymio_barcode_reader [2023/06/27 16:12] (Version actuelle) – [Specifications] marie
Ligne 8: Ligne 8:
   * wav mono sound files under 8000hz, without metadata, encoded "unsigned 8 bit PCM"   * wav mono sound files under 8000hz, without metadata, encoded "unsigned 8 bit PCM"
   * a printer, or a sheet of paper and a black pen (not every ink works. if your ink reflects too much ir light, Thymio won't be able to recognize it. to avoid this, prefer carbon black ink.)   * a printer, or a sheet of paper and a black pen (not every ink works. if your ink reflects too much ir light, Thymio won't be able to recognize it. to avoid this, prefer carbon black ink.)
-Name each of your audio files "px", x being a value between 0 and 32767. Place them at the root of your micro-SD card, and then insert it in Thymio. Plug Thymio in your computer, open Aseba Studio, and open the code. Edit the ''call sound.play(x)'' lines under ''#--- execution'' and replace x with the name of the value you chose for your wav files (example: if your file is named "p16", write ''call sound.play(16)''). Then, run the code.+Name each of your audio files "px", x being a value between 0 and 32767. Place them at the root of your micro-SD card, and then insert it in Thymio. Plug Thymio to your computer, open Aseba Studio, and open the code. Edit the ''call sound.play(x)'' lines under ''#--- execution'' and replace x with the name of the value you chose for your wav files (example: if your file is named "p16", write ''call sound.play(16)''). Then, run the code.
  
 Next, you need a sheet of paper with some black lines drawn on. Note that each line and each space between the lines must be minimum 0,5mm and maximum 9cm wide, and minimum 8cm long. Different notes are registered every 0,5mm, and it may read a total of 20 notes. This may be edited in the code, but keep the motor speeds low. If Thymio moves any faster, it can't keep up as well, and gives false values. Next, you need a sheet of paper with some black lines drawn on. Note that each line and each space between the lines must be minimum 0,5mm and maximum 9cm wide, and minimum 8cm long. Different notes are registered every 0,5mm, and it may read a total of 20 notes. This may be edited in the code, but keep the motor speeds low. If Thymio moves any faster, it can't keep up as well, and gives false values.
Ligne 16: Ligne 16:
 #this code reads barcodes based on bar width #this code reads barcodes based on bar width
   
-#speed = 0,5 cm/s ; max 40 notes ; different note every 0,5 cm ; 9 different notes ; min width 0,5 cm ; max width 9cm ; min length 5 cm but 8 recommended ; ink must absorb ir light (carbon black)+#speed = 0,5 cm/s ; max 20 notes ; different note every 0,5 cm ; 9 different notes ; min width 0,5 cm ; max width 9cm ; min length 5 cm but 8 recommended ; ink must absorb ir light (carbon black)
 #prioritize the bars to be too big rather than too small (for example, if a bar should be 3cm; 3,4cm > 2,9cm). in fact, do make them a millimeter or two wider #prioritize the bars to be too big rather than too small (for example, if a bar should be 3cm; 3,4cm > 2,9cm). in fact, do make them a millimeter or two wider
 </code> </code>
-These are just specifications, conditions for the code to work as intended and limitations.+These are just specifications, conditions for the code to work as intended and limitations. Disregard "max 40 notes" in the original code, its maximum is 20, I just got myself mixed up.
 ==== Setup ==== ==== Setup ====
 <code> <code>
  • howto/thymio/thymio_barcode_reader.1687874123.txt.gz
  • Dernière modification : 2023/06/27 15:55
  • de marie