project for 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
Diff: hardware.cpp
- Revision:
- 9:c9d6eda597b0
- Parent:
- 8:2e18a96e0c77
- Child:
- 12:5141f85e0be6
--- a/hardware.cpp Tue Nov 24 12:35:16 2020 +0000 +++ b/hardware.cpp Tue Nov 24 22:25:57 2020 +0000 @@ -18,7 +18,7 @@ uLCD_4DGL uLCD(p9,p10,p11); // LCD Screen (tx, rx, reset) //SDFileSystem sd(p5, p6, p7, p8, "sd"); // SD Card(mosi, miso, sck, cs) Serial pc(USBTX,USBRX); // USB Console (tx, rx) -MMA8452 acc(p28, p27, 100000); // Accelerometer (sda, sdc, rate) +MMA8452 acc(p28, p27, 100000); // Accelerometer (sda, sdc, rate) DigitalIn button1(p21); // Pushbuttons (pin) DigitalIn button2(p22); DigitalIn button3(p23); @@ -31,10 +31,8 @@ // properly. Do that here. int hardware_init() { - // Crank up the speed and init LCD + // Crank up the speed uLCD.baudrate(3000000); - uLCD.background_color(BLACK); - uLCD.cls(); pc.baud(115200); //Initialize pushbuttons @@ -42,9 +40,6 @@ button2.mode(PullUp); button3.mode(PullUp); - //Initialize accelerometer - acc.init(); - return ERROR_NONE; } @@ -54,11 +49,5 @@ GameInputs read_inputs() { GameInputs in; - in->ax = acc.readX(); - in->ay = acc.readY(); - in->az = acc.readZ(); - in->b1 = button1.read(); - in->b2 = button2.read(); - in->b3 = button3.read(); return in; }