-
Notifications
You must be signed in to change notification settings - Fork 1
/
myApps.c
60 lines (54 loc) · 1.03 KB
/
myApps.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "pico/stdlib.h"
#include "window.h"
void fibonacci(void *appWindow)
{
uint64_t a = 0, b = 1, c;
while (true)
{
if (c > 9000000)
{
a = 0;
b = 1;
Window_clear(appWindow);
}
Window_printf(appWindow, "\n%u", a);
c = a + b;
a = b;
b = c;
Window_delay(500);
}
}
void xPlusY(void *appWindow)
{
float x, y;
while (true)
{
Window_printf(appWindow, "Enter two numbers\n");
Window_scanf(appWindow, "%f%f", &x, &y);
Window_printf(appWindow, "%.2f + %.2f = %.2f\n\n", x, y, x + y);
}
}
void stickyNote(void *appWindow)
{
Window_printf(appWindow, "Use Shift+Tab to change\nfocus between windows!\n");
Window_printf(appWindow, "You can type in this\narea!");
while (true)
{
char c = Window_getchar(appWindow);
Window_printf(appWindow, "%c", c);
}
}
void helloWorld(void *appWindow)
{
while (true)
{
for (int i = 1; i < 8; i++)
{
Window_setTextColour(appWindow, i);
Window_printf(appWindow, "Hello world! ");
Window_delay(100);
}
Window_printf(appWindow, "\n");
Window_delay(1000);
}
}