MIDI Interface in progress

Dependencies:   SPI_TFT_ILI9341 TFT_fonts Touch_tft PowerControl mbed USBMIDI

Committer:
Vekotin
Date:
Mon Feb 24 09:54:44 2014 +0000
Revision:
15:c297064a829b
Parent:
10:ff7cdaeb8b9a
Child:
16:f4d090f1e6ed
kiguli, touchscreen vaatii updateeeeee

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