[ 1 comment ] ( 10 views ) | [ 0 trackbacks ] | permalink | related link
#!/usr/bin/python
import math
from numpy import arange
charge = []
R = 1
C = 0.1
Vc = 0.0
for t in arange(0, 1.6, 1 / (1024.0 * 1.6)):
Vc = 1 - math.exp(-t/(R*C))
charge.append(Vc)
pos = 0
spl = 0
top1023 = charge[:1024]
for item in top1023:
#print " charge %.8f" % item
#print "discharge %.8f" % (1.0 - item)
#print "uint16_t[%d] = discharge %d" % (pos, (((1 - item) * 1024) - 1))
print "%d, " % (((1 - item) * 1024) - 1),
pos += 1
spl += 1
if spl > 15:
spl = 0
print "elements: %d" % len(top1023)
1023, 1016, 1010, 1004, 998, 992, 986, 980, 974, 968, 962, 956, 950, 944, 939, 933,
927, 922, 916, 910, 905, 899, 894, 888, 883, 878, 872, 867, 862, 856, 851, 846,
841, 836, 831, 826, 821, 816, 811, 806, 801, 796, 791, 786, 781, 777, 772, 767,
762, 758, 753, 749, 744, 739, 735, 730, 726, 722, 717, 713, 708, 704, 700, 696,
691, 687, 683, 679, 675, 671, 666, 662, 658, 654, 650, 646, 642, 639, 635, 631,
627, 623, 619, 616, 612, 608, 604, 601, 597, 593, 590, 586, 583, 579, 575, 572,
568, 565, 562, 558, 555, 551, 548, 545, 541, 538, 535, 531, 528, 525, 522, 519,
515, 512, 509, 506, 503, 500, 497, 494, 491, 488, 485, 482, 479, 476, 473, 470,
467, 464, 462, 459, 456, 453, 450, 448, 445, 442, 440, 437, 434, 432, 429, 426,
424, 421, 419, 416, 413, 411, 408, 406, 403, 401, 399, 396, 394, 391, 389, 387,
384, 382, 379, 377, 375, 373, 370, 368, 366, 364, 361, 359, 357, 355, 353, 350,
348, 346, 344, 342, 340, 338, 336, 334, 332, 330, 328, 326, 324, 322, 320, 318,
316, 314, 312, 310, 308, 306, 304, 302, 301, 299, 297, 295, 293, 292, 290, 288,
286, 284, 283, 281, 279, 278, 276, 274, 272, 271, 269, 268, 266, 264, 263, 261,
259, 258, 256, 255, 253, 252, 250, 249, 247, 245, 244, 242, 241, 240, 238, 237,
235, 234, 232, 231, 229, 228, 227, 225, 224, 223, 221, 220, 218, 217, 216, 214,
213, 212, 211, 209, 208, 207, 205, 204, 203, 202, 200, 199, 198, 197, 196, 194,
193, 192, 191, 190, 188, 187, 186, 185, 184, 183, 182, 181, 179, 178, 177, 176,
175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160,
159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 146, 145,
144, 143, 142, 141, 140, 139, 139, 138, 137, 136, 135, 134, 133, 133, 132, 131,
130, 129, 129, 128, 127, 126, 125, 125, 124, 123, 122, 122, 121, 120, 119, 119,
118, 117, 117, 116, 115, 114, 114, 113, 112, 112, 111, 110, 110, 109, 108, 108,
107, 106, 106, 105, 104, 104, 103, 102, 102, 101, 100, 100, 99, 99, 98, 97,
97, 96, 96, 95, 94, 94, 93, 93, 92, 92, 91, 90, 90, 89, 89, 88,
88, 87, 87, 86, 85, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80,
79, 79, 78, 78, 77, 77, 76, 76, 75, 75, 75, 74, 74, 73, 73, 72,
72, 71, 71, 70, 70, 70, 69, 69, 68, 68, 67, 67, 67, 66, 66, 65,
65, 65, 64, 64, 63, 63, 63, 62, 62, 61, 61, 61, 60, 60, 60, 59,
59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 54, 54, 54,
53, 53, 53, 52, 52, 52, 51, 51, 51, 50, 50, 50, 49, 49, 49, 48,
48, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 45, 44, 44, 44,
43, 43, 43, 43, 42, 42, 42, 42, 41, 41, 41, 41, 40, 40, 40, 40,
39, 39, 39, 39, 38, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 36,
36, 35, 35, 35, 35, 34, 34, 34, 34, 34, 33, 33, 33, 33, 32, 32,
32, 32, 32, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 29, 29,
29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 26, 26,
26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 24,
24, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 21, 21,
21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19,
19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17,
17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
top1023.reverse()
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17,
17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21,
21, 21, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 24,
24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26,
26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29,
29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32,
32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 36,
36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48,
48, 49, 49, 49, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53,
54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59,
59, 60, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65,
65, 66, 66, 67, 67, 67, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72,
72, 73, 73, 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79,
80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 87, 87, 88,
88, 89, 89, 90, 90, 91, 92, 92, 93, 93, 94, 94, 95, 96, 96, 97,
97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 106, 107,
108, 108, 109, 110, 110, 111, 112, 112, 113, 114, 114, 115, 116, 117, 117, 118,
119, 119, 120, 121, 122, 122, 123, 124, 125, 125, 126, 127, 128, 129, 129, 130,
131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144,
145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 193,
194, 196, 197, 198, 199, 200, 202, 203, 204, 205, 207, 208, 209, 211, 212, 213,
214, 216, 217, 218, 220, 221, 223, 224, 225, 227, 228, 229, 231, 232, 234, 235,
237, 238, 240, 241, 242, 244, 245, 247, 249, 250, 252, 253, 255, 256, 258, 259,
261, 263, 264, 266, 268, 269, 271, 272, 274, 276, 278, 279, 281, 283, 284, 286,
288, 290, 292, 293, 295, 297, 299, 301, 302, 304, 306, 308, 310, 312, 314, 316,
318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348,
350, 353, 355, 357, 359, 361, 364, 366, 368, 370, 373, 375, 377, 379, 382, 384,
387, 389, 391, 394, 396, 399, 401, 403, 406, 408, 411, 413, 416, 419, 421, 424,
426, 429, 432, 434, 437, 440, 442, 445, 448, 450, 453, 456, 459, 462, 464, 467,
470, 473, 476, 479, 482, 485, 488, 491, 494, 497, 500, 503, 506, 509, 512, 515,
519, 522, 525, 528, 531, 535, 538, 541, 545, 548, 551, 555, 558, 562, 565, 568,
572, 575, 579, 583, 586, 590, 593, 597, 601, 604, 608, 612, 616, 619, 623, 627,
631, 635, 639, 642, 646, 650, 654, 658, 662, 666, 671, 675, 679, 683, 687, 691,
696, 700, 704, 708, 713, 717, 722, 726, 730, 735, 739, 744, 749, 753, 758, 762,
767, 772, 777, 781, 786, 791, 796, 801, 806, 811, 816, 821, 826, 831, 836, 841,
846, 851, 856, 862, 867, 872, 878, 883, 888, 894, 899, 905, 910, 916, 922, 927,
933, 939, 944, 950, 956, 962, 968, 974, 980, 986, 992, 998, 1004, 1010, 1016, 1023
#!/usr/bin/python
import math
from numpy import arange
charge = []
R = 1
C = 0.1
Vc = 0.0
for t in arange(0, 1.1, 1 / (1024.0 * 1.1)):
Vc = 1 - math.exp(-t/(R*C))
charge.append(Vc)
pos = 0
spl = 0
top1023 = []
top1023 = charge[:1024]
#top1023.reverse()
for item in top1023:
print "%d, " % (((1 - item) * 1048575)),
pos += 1
spl += 1
if spl > 15:
spl = 0
print "elements: %d" % len(top1023)
1048575, 1039307, 1030121, 1021016, 1011992, 1003047, 994182, 985394, 976685, 968052, 959496, 951016, 942610, 934279, 926021, 917836,
909724, 901683, 893714, 885815, 877985, 870225, 862534, 854910, 847354, 839865, 832441, 825084, 817791, 810563, 803399, 796298,
789260, 782284, 775370, 768517, 761724, 754992, 748319, 741704, 735149, 728651, 722211, 715828, 709501, 703230, 697014, 690854,
684748, 678695, 672697, 666751, 660858, 655017, 649228, 643489, 637802, 632165, 626577, 621039, 615550, 610109, 604717, 599372,
594074, 588824, 583619, 578461, 573348, 568281, 563258, 558280, 553345, 548454, 543607, 538802, 534040, 529320, 524641, 520004,
515408, 510853, 506337, 501862, 497426, 493030, 488672, 484353, 480072, 475829, 471623, 467455, 463323, 459228, 455169, 451146,
447159, 443206, 439289, 435406, 431558, 427744, 423963, 420216, 416502, 412820, 409172, 405555, 401971, 398418, 394896, 391406,
387947, 384518, 381119, 377751, 374412, 371103, 367823, 364572, 361349, 358155, 354990, 351852, 348742, 345660, 342605, 339577,
336575, 333601, 330652, 327730, 324833, 321962, 319116, 316296, 313500, 310729, 307983, 305261, 302563, 299888, 297238, 294611,
292007, 289426, 286868, 284332, 281819, 279328, 276859, 274412, 271987, 269583, 267200, 264838, 262498, 260178, 257878, 255599,
253340, 251100, 248881, 246681, 244501, 242340, 240198, 238075, 235971, 233885, 231818, 229769, 227738, 225725, 223730, 221753,
219793, 217850, 215925, 214016, 212125, 210250, 208391, 206549, 204724, 202914, 201121, 199343, 197581, 195835, 194104, 192389,
190688, 189003, 187332, 185676, 184035, 182409, 180797, 179199, 177615, 176045, 174489, 172947, 171418, 169903, 168401, 166913,
165437, 163975, 162526, 161089, 159666, 158254, 156856, 155469, 154095, 152733, 151383, 150045, 148719, 147405, 146102, 144810,
143530, 142262, 141004, 139758, 138523, 137299, 136085, 134882, 133690, 132508, 131337, 130176, 129026, 127885, 126755, 125635,
124524, 123424, 122333, 121252, 120180, 119118, 118065, 117021, 115987, 114962, 113946, 112939, 111940, 110951, 109970, 108998,
108035, 107080, 106134, 105196, 104266, 103344, 102431, 101526, 100628, 99739, 98857, 97983, 97117, 96259, 95408, 94565,
93729, 92901, 92080, 91266, 90459, 89660, 88867, 88082, 87303, 86531, 85767, 85009, 84257, 83513, 82774, 82043,
81318, 80599, 79887, 79180, 78481, 77787, 77099, 76418, 75743, 75073, 74410, 73752, 73100, 72454, 71813, 71179,
70550, 69926, 69308, 68695, 68088, 67486, 66890, 66299, 65713, 65132, 64556, 63986, 63420, 62860, 62304, 61753,
61208, 60667, 60130, 59599, 59072, 58550, 58032, 57520, 57011, 56507, 56008, 55513, 55022, 54536, 54054, 53576,
53102, 52633, 52168, 51707, 51250, 50797, 50348, 49903, 49462, 49025, 48591, 48162, 47736, 47314, 46896, 46482,
46071, 45663, 45260, 44860, 44463, 44070, 43681, 43295, 42912, 42533, 42157, 41784, 41415, 41049, 40686, 40326,
39970, 39617, 39267, 38920, 38576, 38235, 37897, 37562, 37230, 36901, 36574, 36251, 35931, 35613, 35298, 34986,
34677, 34371, 34067, 33766, 33467, 33172, 32878, 32588, 32300, 32014, 31731, 31451, 31173, 30897, 30624, 30354,
30085, 29819, 29556, 29295, 29036, 28779, 28525, 28272, 28023, 27775, 27529, 27286, 27045, 26806, 26569, 26334,
26101, 25871, 25642, 25415, 25191, 24968, 24747, 24529, 24312, 24097, 23884, 23673, 23464, 23256, 23051, 22847,
22645, 22445, 22246, 22050, 21855, 21662, 21470, 21281, 21092, 20906, 20721, 20538, 20357, 20177, 19998, 19822,
19646, 19473, 19301, 19130, 18961, 18793, 18627, 18463, 18299, 18138, 17977, 17818, 17661, 17505, 17350, 17197,
17045, 16894, 16745, 16597, 16450, 16305, 16161, 16018, 15876, 15736, 15597, 15459, 15322, 15187, 15053, 14919,
14788, 14657, 14527, 14399, 14272, 14146, 14021, 13897, 13774, 13652, 13531, 13412, 13293, 13176, 13059, 12944,
12829, 12716, 12604, 12492, 12382, 12272, 12164, 12056, 11950, 11844, 11739, 11636, 11533, 11431, 11330, 11230,
11130, 11032, 10935, 10838, 10742, 10647, 10553, 10460, 10367, 10276, 10185, 10095, 10006, 9917, 9830, 9743,
9657, 9571, 9487, 9403, 9320, 9237, 9156, 9075, 8994, 8915, 8836, 8758, 8681, 8604, 8528, 8452,
8378, 8304, 8230, 8158, 8085, 8014, 7943, 7873, 7803, 7734, 7666, 7598, 7531, 7465, 7399, 7333,
7268, 7204, 7140, 7077, 7015, 6953, 6891, 6830, 6770, 6710, 6651, 6592, 6534, 6476, 6419, 6362,
6306, 6250, 6195, 6140, 6086, 6032, 5979, 5926, 5873, 5822, 5770, 5719, 5669, 5618, 5569, 5520,
5471, 5422, 5374, 5327, 5280, 5233, 5187, 5141, 5096, 5051, 5006, 4962, 4918, 4874, 4831, 4789,
4746, 4704, 4663, 4621, 4581, 4540, 4500, 4460, 4421, 4382, 4343, 4305, 4267, 4229, 4191, 4154,
4118, 4081, 4045, 4009, 3974, 3939, 3904, 3870, 3835, 3801, 3768, 3735, 3702, 3669, 3636, 3604,
3572, 3541, 3509, 3478, 3448, 3417, 3387, 3357, 3327, 3298, 3269, 3240, 3211, 3183, 3155, 3127,
3099, 3072, 3045, 3018, 2991, 2965, 2938, 2912, 2887, 2861, 2836, 2811, 2786, 2761, 2737, 2713,
2689, 2665, 2641, 2618, 2595, 2572, 2549, 2527, 2504, 2482, 2460, 2439, 2417, 2396, 2374, 2353,
2333, 2312, 2292, 2271, 2251, 2231, 2212, 2192, 2173, 2154, 2134, 2116, 2097, 2078, 2060, 2042,
2024, 2006, 1988, 1971, 1953, 1936, 1919, 1902, 1885, 1868, 1852, 1835, 1819, 1803, 1787, 1771,
1756, 1740, 1725, 1710, 1694, 1679, 1665, 1650, 1635, 1621, 1606, 1592, 1578, 1564, 1550, 1537,
1523, 1510, 1496, 1483, 1470, 1457, 1444, 1431, 1419, 1406, 1394, 1381, 1369, 1357, 1345, 1333,
1321, 1310, 1298, 1287, 1275, 1264, 1253, 1242, 1231, 1220, 1209, 1198, 1188, 1177, 1167, 1157,
1146, 1136, 1126, 1116, 1106, 1097, 1087, 1077, 1068, 1058, 1049, 1040, 1030, 1021, 1012, 1003,
994, 986, 977, 968, 960, 951, 943, 935, 926, 918, 910, 902, 894, 886, 878, 870,
863, 855, 848, 840, 833, 825, 818, 811, 804, 796, 789, 782, 775, 769, 762, 755,
748, 742, 735, 729, 722, 716, 710, 703, 697, 691, 685, 679, 673, 667, 661, 655,
649, 644, 638, 632, 627, 621, 616, 610, 605, 599, 594, 589, 584, 578, 573, 568,
563, 558, 553, 548, 544, 539, 534, 529, 525, 520, 515, 511, 506, 502, 497, 493,
489, 484, 480, 476, 471, 467, 463, 459, 455, 451, 447, 443, 439, 435, 431, 428,
424, 420, 416, 413, 409, 405, 402, 398, 395, 391, 388, 384, 381, 378, 374, 371,
368, 364, 361, 358, 355, 352, 349, 345, 342, 339, 336, 333, 330, 327, 325, 322,
319, 316, 313, 310, 308, 305, 302, 300, 297, 294, 292, 289, 287, 284, 282, 279,
277, 274, 272, 269, 267, 265, 262, 260, 258, 255, 253, 251, 249, 246, 244, 242,
240, 238, 236, 234, 232, 229, 227, 225, 223, 221, 219, 218, 216, 214, 212, 210,
208, 206, 204, 203, 201, 199, 197, 195, 194, 192, 190, 189, 187, 185, 184, 182,
180, 179, 177, 176, 174, 173, 171, 170, 168, 167, 165, 164, 162, 161, 159, 158,
156, 155, 154, 152, 151, 150, 148, 147, 146, 144, 143, 142, 141, 139, 138, 137,
136, 134, 133, 132, 131, 130, 129, 127, 126, 125, 124, 123, 122, 121, 120, 119
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink | related link
#!/bin/bash
echo -n "enter servername:"
read SERVERNAME
# Create _2048bit_rsa_key_ for server
openssl genrsa -out ${SERVERNAME}.key 2048
# Generate a certificate signing request based on an existing certificate
openssl req -new -key ${SERVERNAME}.key -out ${SERVERNAME}.csr
# Sign csr with the CA private key using CSR you just made
openssl x509 -req -days 1825 -in ${SERVERNAME}.csr -CA cacert.pem -CAkey \
cakey.pem -CAcreateserial -out ${SERVERNAME}.crt
# Convert to PEM
openssl x509 -in ${SERVERNAME}.crt -out ${SERVERNAME}.pem -outform PEM
# Verify certificate
openssl x509 -in ${SERVERNAME}.crt -text -noout
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink
http://www.bernacomp.com/elec/og2/og3_moogladder.html
http://wby12p2ks.homepage.t-online.de/wrdprs/?cat=12
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink | related link
SDFileSystemDMA inherited from Official SDFileSystem.
https://developer.mbed.org/users/mimi3/code/SDFileSystemDMA/
FastPWM
https://developer.mbed.org/users/Sissors/code/FastPWM/
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink
unsigned int const sinetable[512] = {
1023,1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,1022,1021,
1021,1021,1021,1021,1021,1020,1020,1020,1020,1019,1019,1019,1019,1018,1018,1018,
1018,1017,1017,1017,1016,1016,1016,1015,1015,1014,1014,1014,1013,1013,1012,1012,
1011,1011,1010,1010,1009,1009,1008,1008,1007,1007,1006,1006,1005,1005,1004,1003,
1003,1002,1002,1001,1000,1000,999,998,998,997,996,996,995,994,993,993,
992,991,990,989,989,988,987,986,985,985,984,983,982,981,980,979,
978,977,977,976,975,974,973,972,971,970,969,968,967,966,965,964,
963,962,961,959,958,957,956,955,954,953,952,950,949,948,947,946,
945,943,942,941,940,938,937,936,935,933,932,931,929,928,927,926,
924,923,921,920,919,917,916,915,913,912,910,909,907,906,905,903,
902,900,899,897,896,894,893,891,889,888,886,885,883,882,880,878,
877,875,874,872,870,869,867,865,864,862,860,859,857,855,853,852,
850,848,846,845,843,841,839,838,836,834,832,830,828,827,825,823,
821,819,817,815,813,812,810,808,806,804,802,800,798,796,794,792,
790,788,786,784,782,780,778,776,774,772,770,768,766,764,761,759,
757,755,753,751,749,747,744,742,740,738,736,734,731,729,727,725,
723,720,718,716,714,711,709,707,705,702,700,698,695,693,691,689,
686,684,682,679,677,674,672,670,667,665,663,660,658,655,653,651,
648,646,643,641,638,636,633,631,628,626,624,621,619,616,614,611,
608,606,603,601,598,596,593,591,588,586,583,580,578,575,573,570,
567,565,562,560,557,554,552,549,546,544,541,538,536,533,530,528,
525,522,520,517,514,511,509,506,503,500,498,495,492,490,487,484,
481,478,476,473,470,467,465,462,459,456,453,450,448,445,442,439,
436,433,431,428,425,422,419,416,413,411,408,405,402,399,396,393,
390,387,385,382,379,376,373,370,367,364,361,358,355,352,349,346,
343,341,338,335,332,329,326,323,320,317,314,311,308,305,302,299,
296,293,290,287,284,281,278,275,272,269,266,263,259,256,253,250,
247,244,241,238,235,232,229,226,223,220,217,214,211,208,204,201,
198,195,192,189,186,183,180,177,174,170,167,164,161,158,155,152,
149,146,143,139,136,133,130,127,124,121,118,114,111,108,105,102,
99,96,93,89,86,83,80,77,74,71,68,64,61,58,55,52,
49,46,42,39,36,33,30,27,24,20,17,14,11,8,5,2
};
#include <stdio.h>
#include "sinetable.h"
#include <stdint.h>
int16_t get_sine(uint16_t position) {
// @ inputs: position in wave 0 - 2047
if(position < 1024) {
if(position < 512) {
// Q1
//return(position);
return(sinetable[position]);
} else {
// Q2
position = 511 + (512 - position);
//return(position);
return( -1 * sinetable[position]);
}
} else {
if(position < 1024 + 512) {
// Q3
position = -1 * (1024 - position);
//return(position);
return( -1 * sinetable[position]);
} else {
// Q4
position = 1023 + 1024 - position;
//return(position);
return(sinetable[position]);
}
}
}
uint16_t sine_t_pos = 0; // sinetable position
uint16_t sine_s_ctr = 0; // sine speed counter
uint16_t get_scaled_sine(uint16_t offset, uint16_t speed, uint16_t modulation) {
// @ input offset: 0 - 1023 /10bit/
// @ input speed: 0 - 1023 /10bit/
// @ input modulation: 0 - 1023 /10bit/
// @ function output: 0 - 1023 /10bit/
int32_t sine;
if(sine_s_ctr < speed) {
sine_s_ctr += 1;
} else {
sine_s_ctr = 0;
if(sine_t_pos < 2047) {
sine_t_pos++;
} else {
sine_t_pos = 0;
}
}
sine = get_sine(sine_t_pos);
sine = sine * (1 + modulation);
sine = sine >> 11;
sine = sine + offset;
if(sine < 1024) {
if(sine < 0) {
return((uint16_t) 0);
} else {
return((uint16_t) sine);
}
} else {
return((uint16_t) 1023);
}
}
main(void) {
uint32_t c, d;
uint16_t sine;
for(c=0; c<65535<<4; c++) {
sine = get_scaled_sine(512, 1, 512);
printf("sine: %d\n\r", sine);
}
}
[ 2 comments ] ( 11 views ) | [ 0 trackbacks ] | permalink
http://arduinomidilib.fortyseveneffects.com/index.html
https://developer.mbed.org/users/okini3939/code/MIDI/file/0eeca7deec08/MIDI.cpp
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink
NTC - negative resistance coefficient, resistance decreases with temperature
PTC - positive resistance coefficient, resistance increases with temperature
Temperature coefficient: 50ppm/°C
Meaning that the change in value due to a temperature change of 1°C will not be more than 50Ω for every 1MΩ of the resistor's value (or 0.05Ω for every 1KΩ of its value).
Temperature coefficient: 2750K ppm/°C
Meaning that the change in value due to a temperature change of 1°C will not be more than 2750Ω for every 1MΩ of the resistor's value (or 2.75Ω for every 1KΩ of its value).
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink | related link
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink | related link
http://www.logwell.com/tech/components/ ... alues.html
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink | related link