Updated guide – no root required
- This guide is not a beginner step-by-step tutorial. Basic familiarity with ADB and Android system settings is assumed.
- No root or bootloader unlocking is required for this updated method.
Updated guide – no root required
| /* | |
| Public domain, do whatever you want. | |
| I wrote this snippet because I needed to add thousands separators to some numbers | |
| and I wanted to avoid using locale-related code because: | |
| - I wanted this code to be locale agnostic and always return the same result | |
| - I didn't want to set the locale for the whole program just to do something like this | |
| This is not meant to be fast and it can indeed be optimized. It's fine for my purposes. |
| #define OUT_PIN 5 | |
| // Note to frequency table | |
| const uint16_t ftable[128] PROGMEM = {8, 9, 9, 10, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 19, 21, 22, 23, 24, 26, 28, 29, 31, 33, 35, 37, 39, 41, 44, 46, 49, 52, 55, 58, 62, 65, 69, 73, 78, 82, 87, 92, 98, 104, 110, 117, 123, 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1976, 2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951, 4186, 4435, 4699, 4978, 5274, 5588, 5920, 5920, 6645, 7040, 7459, 7902, 8372, 8870, 9397, 9956, 10548, 11175, 11840, 12544}; | |
| // 0 No sustain (stop notes on 0) | |
| // 1 Half sustain (wait half of the delay before stopping notes) | |
| // 2 Full sustain (keep notes running as long as they want) | |
| #define SUSTAIN 1 | |
| //Frequency gain |
I hereby claim:
To claim this, I am signing this object: