MIDI Interface in progress

Dependencies:   SPI_TFT_ILI9341 TFT_fonts Touch_tft PowerControl mbed USBMIDI

Committer:
MetropoliaMies
Date:
Mon Feb 24 11:14:08 2014 +0000
Revision:
18:881b5f2975bc
Parent:
16:f4d090f1e6ed
PowerControl lis?tty, slider v?ritys ei toimi

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vekotin 0:98b5cd030eee 1 #include "mbed.h"
Vekotin 0:98b5cd030eee 2 #include "Arial12x12.h"
Vekotin 15:c297064a829b 3 #include "Arial24x23.h"
MetropoliaMies 4:76c054f8b97e 4
Vekotin 0:98b5cd030eee 5 #include "USBMIDI.h"
Vekotin 15:c297064a829b 6 #include "touch_interface.h"
Vekotin 2:478274cba6c3 7
MetropoliaMies 16:f4d090f1e6ed 8
MetropoliaMies 16:f4d090f1e6ed 9
MetropoliaMies 16:f4d090f1e6ed 10
Vekotin 15:c297064a829b 11 point p;
tanssisatu 7:4aec4a6acac2 12
MetropoliaMies 4:76c054f8b97e 13 int main()
MetropoliaMies 4:76c054f8b97e 14 {
Vekotin 2:478274cba6c3 15 // PERUSPOHJA, ÄLÄ MUOKKAA!
Vekotin 0:98b5cd030eee 16 tft.claim(stdout); // send stdout to the TFT display
Vekotin 0:98b5cd030eee 17 tft.background(Black); // set background to black
Vekotin 15:c297064a829b 18 tft.foreground(White); // set chars and buttons to white
Vekotin 0:98b5cd030eee 19 tft.cls(); // clear the screen
Vekotin 2:478274cba6c3 20 tft.set_font((unsigned char*) Arial12x12); // select the font
MetropoliaMies 4:76c054f8b97e 21
Vekotin 15:c297064a829b 22 tft.set_orientation(0); //screen calibration
Vekotin 0:98b5cd030eee 23 tft.calibrate();
MetropoliaMies 4:76c054f8b97e 24
Vekotin 15:c297064a829b 25 tft.locate(85,0); //info texts
MetropoliaMies 4:76c054f8b97e 26 printf(" Octave = ");
MetropoliaMies 4:76c054f8b97e 27 tft.locate(85, 12);
MetropoliaMies 4:76c054f8b97e 28 printf(" Slider = ");
MetropoliaMies 4:76c054f8b97e 29
Vekotin 0:98b5cd030eee 30 tft.locate(0,0);
MetropoliaMies 4:76c054f8b97e 31 printf(" MIDIMAN! ");
MetropoliaMies 4:76c054f8b97e 32 tft.line(0,83,239,83,White);
MetropoliaMies 16:f4d090f1e6ed 33
MetropoliaMies 16:f4d090f1e6ed 34 powerdown();
MetropoliaMies 4:76c054f8b97e 35
Vekotin 15:c297064a829b 36 Draw_buttons(White);
MetropoliaMies 5:8e13103b41be 37
Vekotin 15:c297064a829b 38 while (1) {
MetropoliaMies 16:f4d090f1e6ed 39 /*
Vekotin 15:c297064a829b 40 tft.locate(90,275);
Vekotin 15:c297064a829b 41 printf("DOWN");
Vekotin 15:c297064a829b 42 tft.locate(170,275);
Vekotin 15:c297064a829b 43 printf("UP");
MetropoliaMies 16:f4d090f1e6ed 44 */
Vekotin 15:c297064a829b 45 if (tft.is_touched(tft.get_touch())) { // touch
Vekotin 15:c297064a829b 46 p = tft.get_touch();
Vekotin 15:c297064a829b 47 p = tft.to_pixel(p); // convert to pixel position
MetropoliaMies 4:76c054f8b97e 48
Vekotin 15:c297064a829b 49 Octave_buttons(Red,p);
Vekotin 15:c297064a829b 50 Slider_action(p); // pitch slider
Vekotin 10:ff7cdaeb8b9a 51
MetropoliaMies 4:76c054f8b97e 52 tft.locate(160, 0);
tanssisatu 9:df3bff3a0b76 53 printf("%i", Oct);
MetropoliaMies 4:76c054f8b97e 54 tft.locate(160, 12);
Vekotin 15:c297064a829b 55 printf("jee");
MetropoliaMies 6:17e0520e346f 56 }
Vekotin 15:c297064a829b 57 Nine_keys();
MetropoliaMies 6:17e0520e346f 58 }
Vekotin 0:98b5cd030eee 59 }
Vekotin 0:98b5cd030eee 60
Vekotin 0:98b5cd030eee 61
Vekotin 0:98b5cd030eee 62
Vekotin 0:98b5cd030eee 63