Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

myWaveform.ino 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const int16_t myWaveform[256] = {
  2. 0, 1895, 3748, 5545, 7278, 8934, 10506, 11984, 13362, 14634,
  3. 15794, 16840, 17769, 18580, 19274, 19853, 20319, 20678, 20933, 21093,
  4. 21163, 21153, 21072, 20927, 20731, 20492, 20221, 19929, 19625, 19320,
  5. 19022, 18741, 18486, 18263, 18080, 17942, 17853, 17819, 17841, 17920,
  6. 18058, 18254, 18507, 18813, 19170, 19573, 20017, 20497, 21006, 21538,
  7. 22085, 22642, 23200, 23753, 24294, 24816, 25314, 25781, 26212, 26604,
  8. 26953, 27256, 27511, 27718, 27876, 27986, 28049, 28068, 28047, 27989,
  9. 27899, 27782, 27644, 27490, 27326, 27159, 26996, 26841, 26701, 26582,
  10. 26487, 26423, 26392, 26397, 26441, 26525, 26649, 26812, 27012, 27248,
  11. 27514, 27808, 28122, 28451, 28787, 29124, 29451, 29762, 30045, 30293,
  12. 30495, 30643, 30727, 30738, 30667, 30509, 30254, 29897, 29433, 28858,
  13. 28169, 27363, 26441, 25403, 24251, 22988, 21620, 20150, 18587, 16939,
  14. 15214, 13423, 11577, 9686, 7763, 5820, 3870, 1926, 0, -1895,
  15. -3748, -5545, -7278, -8934,-10506,-11984,-13362,-14634,-15794,-16840,
  16. -17769,-18580,-19274,-19853,-20319,-20678,-20933,-21093,-21163,-21153,
  17. -21072,-20927,-20731,-20492,-20221,-19929,-19625,-19320,-19022,-18741,
  18. -18486,-18263,-18080,-17942,-17853,-17819,-17841,-17920,-18058,-18254,
  19. -18507,-18813,-19170,-19573,-20017,-20497,-21006,-21538,-22085,-22642,
  20. -23200,-23753,-24294,-24816,-25314,-25781,-26212,-26604,-26953,-27256,
  21. -27511,-27718,-27876,-27986,-28049,-28068,-28047,-27989,-27899,-27782,
  22. -27644,-27490,-27326,-27159,-26996,-26841,-26701,-26582,-26487,-26423,
  23. -26392,-26397,-26441,-26525,-26649,-26812,-27012,-27248,-27514,-27808,
  24. -28122,-28451,-28787,-29124,-29451,-29762,-30045,-30293,-30495,-30643,
  25. -30727,-30738,-30667,-30509,-30254,-29897,-29433,-28858,-28169,-27363,
  26. -26441,-25403,-24251,-22988,-21620,-20150,-18587,-16939,-15214,-13423,
  27. -11577, -9686, -7763, -5820, -3870, -1926
  28. };
  29. /*
  30. #! /usr/bin/perl
  31. $len = 256;
  32. print "const int16_t myWaveform[256] = {\n";
  33. for ($i=0; $i < $len; $i++) {
  34. $x = $i / $len * 2 * 3.141592654;
  35. $r = $x - 0.12486762;
  36. $y = 0.95 * sin($r) + 0.25 * sin($r * 3 + 0.7) + 0.15 * sin($r * 5 - 5.4);
  37. #print "$x $y\n";
  38. $d = sprintf "%.0f", $y * 32767.0;
  39. printf "%6d", $d + 0;
  40. print "," if ($i < $len-1);
  41. print "\n" if ($i % 10) == 9;
  42. }
  43. print "\n" unless ($len % 10) == 9;
  44. print "};\n";
  45. */