EE445M RTOS
Taken at the University of Texas Spring 2015
console-grapher.c
Go to the documentation of this file.
1 #include "g2d_defines.h"
2 #include "graphlib.h"
3 #include "framebuffer.h"
4 #include "graph_framebuffer.h"
5 #include "graphics2d.h"
6 #include "console_framebuffer.h"
7 
8 #include <stdio.h>
9 #include <time.h>
10 #include <math.h>
11 
12 void usleep(long);
13 
14 int main() {
15  int i;
16  int delta = 0;
17  uchar y_range_max = 100;
18  framebuffer fb = FBInit();
19  graph* g = GLCreateGraph(0, 10, 0, y_range_max, 10);
20  GLSetTitle(g, "Graph test");
21  GLLabelAxes(g, "X Axis", "Y Allies");
22 
23  /* GLPushDataPoint(g, 0); */
24  /* GLPushDataPoint(g, 2); */
25  /* GLPushDataPoint(g, 3); */
26  /* GLPushDataPoint(g, 4); */
27  /* GLPushDataPoint(g, 20); */
28  /* GLPushDataPoint(g, 25); */
29  /* GLPushDataPoint(g, 28); */
30  /* GLPushDataPoint(g, 30); */
31  /* GLPushDataPoint(g, 40); */
32  /* GLPushDataPoint(g, 50); */
33  /* GLPushDataPoint(g, 60); */
34  /* GLPushDataPoint(g, 70); */
35  /* GLPushDataPoint(g, 50); */
36  /* GLPushDataPoint(g, 60); */
37  /* GLPushDataPoint(g, 70); */
38  /* GLPushDataPoint(g, 50); */
39  /* GLPushDataPoint(g, 60); */
40  /* GLPushDataPoint(g, 70); */
41  /* */
42  /* FBDrawFullscreenGraph(fb, g); */
43  /* printFramebuffer( G2ConvertFBToRITFormat(fb) ); */
44  while(1) {
45 
47  GLPushDataPoint(g, y_range_max/2*sin(i++) + y_range_max/2);
48  FBDrawFullscreenGraph(fb, g);
50  usleep(250000); // .5 second
51  }
52 
53 }
unsigned char * G2ConvertFBToRITFormat(framebuffer fb)
Definition: graphics2d.c:23
void printFramebuffer(unsigned char *fb)
char * GLSetTitle(graph *g, char *title)
Definition: graphlib.c:42
void GLLabelAxes(graph *g, char *x_axis, char *y_axis)
Definition: graphlib.c:48
graph * GLCreateGraph(long x_min, long x_max, long y_min, long y_max, long x_steps)
Definition: graphlib.c:25
char ** framebuffer
Definition: framebuffer.h:12
void GLPushDataPoint(graph *g, long y_val)
Definition: graphlib.c:56
Definition: graphlib.h:29
unsigned char uchar
Definition: defines.h:34
void usleep(long)
void FBEraseFullscreenGraph(framebuffer fb, graph *g)
void FBDrawFullscreenGraph(framebuffer fb, graph *g)
int main()