Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- el17cd
- Date:
- 2019-02-23
- Revision:
- 6:75031d14fc0d
- Parent:
- 5:54d3b36fec2c
- Child:
- 7:15543cb10a14
File content as of revision 6:75031d14fc0d:
/*
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering
University of Leeds
Name: Christopher Doel
Username: el17cd
Student ID Number: 201146223
Date: 22/02/19
*/
#include "mbed.h"
#include <vector>
#ifndef FACE_H
#define FACE_H
#include "Face.h"
#endif
#include "Rasturizer.h"
#include "Cube.h"
#include "Gamepad.h"
Gamepad gamepad;
int main()
{
gamepad.init();
Rasturizer renderer;
Cube cube1(20,0,40,15);
Cube cube2(-20,0,40,15);
int i = 0;
while(1) {
renderer.clear();
//if (i == 6)
// i = 0;
for (int i = 0; i < 6; i++){
renderer.drawFace(cube1.getFace(i));
}
for (int i = 0; i < 6; i++){
renderer.drawFace(cube2.getFace(i));
}
Vector2D coord = gamepad.get_coord();
cube1.translate(coord.x,0,coord.y);
cube2.translate(coord.x,0,coord.y);
//if(gamepad.check_event(A){
// cube1.rotateX(0.5);
// cube2.rotateX(0.5);
//}
renderer.refresh(); // refresh the LCD so the pixels appear
wait_ms(1000/15); // this gives a refresh rate of 10 frames per second
//i++;
}
}