Hotfix release available: 2025-05-14b "Librarian".
upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian".
upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian".
upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos".
upgrade now! [55.2] (what's this?)
sw:uc
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sw:uc [2009/01/25 12:18] – angelegt 172.22.1.222 | sw:uc [2024/04/15 00:43] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== ATmega ====== | ||
| + | ==== PROGMEM ==== | ||
| + | === Strings + Array === | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | const char ptmpUP_msg[] | ||
| + | const char ptmpDN_msg[] | ||
| + | const char ptmpCLG_msg[] | ||
| + | const char* const pgtmp_msg[] | ||
| + | { ptmpUP_msg, ptmpDN_msg, | ||
| + | </ | ||
| + | |||
| + | oder alternativ mit flash statt PROGMEM: | ||
| + | |||
| + | <code c> | ||
| + | const __flash char ptmpUP_msg[] | ||
| + | const __flash char ptmpDN_msg[] | ||
| + | const __flash char ptmpCLG_msg[] = " | ||
| + | const __flash char* const __flash pgtmp_msg[] = | ||
| + | { ptmpUP_msg, ptmpDN_msg, | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | pgtmp_msg is const and located in flash. | ||
| + | pointers to const locations in flash. | ||
| + | </ | ||
| + | |||
| + | === Functionpointer=== | ||
| + | |||
| + | < | ||
| + | Your functions are of prototype "void (*)(void)", | ||
| + | And the return type is " | ||
| + | diagnostic on this. | ||
| + | </ | ||
| + | If you want to put the array in flash, then put funcArray in flash: | ||
| + | |||
| + | <code c> | ||
| + | void func1 (void) {} | ||
| + | void func2 (void) {} | ||
| + | void func3 (void) {} | ||
| + | |||
| + | void (* const __flash funcArray[])(void) = { func1, func2, func3 } ; | ||
| + | |||
| + | void run (unsigned char funcNo){ | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| ====== Quadratwurzel ====== | ====== Quadratwurzel ====== | ||
| The simplest square root algorithm is to simply subtract successive odd | The simplest square root algorithm is to simply subtract successive odd | ||
| Line 4: | Line 54: | ||
| (9-1=8) (8-3=5) (5-5=0)\\ | (9-1=8) (8-3=5) (5-5=0)\\ | ||
| Three subtractions so the sq root of nine is 3. | Three subtractions so the sq root of nine is 3. | ||
| - | |||
| ====== Dezimalbrüche und Brüche wandeln ====== | ====== Dezimalbrüche und Brüche wandeln ====== | ||
| z.B.faktor=2.12345676\\ | z.B.faktor=2.12345676\\ | ||
sw/uc.1232882292.txt.gz · Last modified: 2024/04/15 00:43 (external edit)
