Track gyro using a DCM.

This brings in an implementation of some general matrix manipulation routines,
not all of which are used at teh moment.

Output the DCM on the UART at 50Hz for the host to display it usefully.
This commit is contained in:
2011-10-07 23:39:28 +00:00
parent 6a700d0dbe
commit 62732758a8
10 changed files with 430 additions and 16 deletions

25
uart.c
View File

@@ -155,6 +155,31 @@ void putint(unsigned int n) {
putstr(s+i);
}
void putint_s(int n) {
char s[12];
int i;
int neg;
/* OK, technically, this might not work properly for the most
* negative possible number. Oh well.
*/
neg = (n < 0);
if (neg)
n = -n;
i = 11;
s[i] = '\0';
do {
s[--i] = n % 10 + '0';
} while ((n /= 10) > 0);
if (neg)
s[--i] = '-';
putstr(s+i);
}
void puthex(unsigned int n) {
char s[9];
int i;