MIDI Interface in progress

Dependencies:   SPI_TFT_ILI9341 TFT_fonts Touch_tft PowerControl mbed USBMIDI

main.cpp

Committer:
MetropoliaMies
Date:
2014-02-24
Revision:
18:881b5f2975bc
Parent:
16:f4d090f1e6ed

File content as of revision 18:881b5f2975bc:

#include "mbed.h"
#include "Arial12x12.h"
#include "Arial24x23.h"

#include "USBMIDI.h"
#include "touch_interface.h"




point p;

int main()
{
    // PERUSPOHJA, ÄLÄ MUOKKAA!
    tft.claim(stdout);        // send stdout to the TFT display
    tft.background(Black);    // set background to black
    tft.foreground(White);    // set chars and buttons to white
    tft.cls();                // clear the screen
    tft.set_font((unsigned char*) Arial12x12);  // select the font

    tft.set_orientation(0);     //screen calibration
    tft.calibrate();

    tft.locate(85,0);           //info texts
    printf(" Octave = ");
    tft.locate(85, 12);
    printf(" Slider = ");

    tft.locate(0,0);
    printf(" MIDIMAN! ");
    tft.line(0,83,239,83,White);
    
    powerdown();

    Draw_buttons(White);

    while (1) {     
/*
        tft.locate(90,275);
        printf("DOWN");
        tft.locate(170,275);
        printf("UP");
*/
        if (tft.is_touched(tft.get_touch())) {                          // touch
            p = tft.get_touch();
            p = tft.to_pixel(p);                                        // convert to pixel position

            Octave_buttons(Red,p);
            Slider_action(p);                                            // pitch slider

            tft.locate(160, 0);
            printf("%i", Oct);
            tft.locate(160, 12);
            printf("jee");
        }
        Nine_keys();
    }
}