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: SPI_TFT_ILI9341 TFT_fonts Touch_tft PowerControl mbed USBMIDI
Diff: light_pressed.h
- Revision:
- 13:f72d45d919b4
- Parent:
- 10:ff7cdaeb8b9a
--- a/light_pressed.h Thu Feb 13 07:36:00 2014 +0000
+++ b/light_pressed.h Thu Feb 13 09:04:51 2014 +0000
@@ -7,7 +7,10 @@
extern int Oct = 0;
extern USBMIDI midi;
+
touch_tft tft(p20,p19,p18,p17,p5, p6, p7, p14, p15, p21, "TFT"); // x+,x-,y+,y-,mosi, miso, sclk, cs, reset, dc
+int oktaavi[11] = {-2,-1,0,1,2,3,4,5,6};
+int o = 5;
void buttons(int b, unsigned short color) //button field
{
@@ -42,6 +45,22 @@
}
}
+void buttons_text(){
+ tft.locate(180,270);
+ tft.foreground(Black);
+ tft.background(White);
+ printf("Octave");
+ tft.locate(190,282);
+ printf("Up");
+ tft.locate(100,270);
+ printf("Octave");
+ tft.locate(102,282);
+ printf("Down");
+ tft.background(Black); // set background to black
+ tft.foreground(White); // set chars to white
+
+}
+
void light_pressed(unsigned short color, point p)
{
@@ -99,12 +118,14 @@
if (p.x > 83 && p.x < 158) { //Octave down
buttons(8, color);
Oct -= 12;
- wait(1);
+ o--;
+ wait(0.1);
}
if (p.x > 163 && p.x < 238) { //Octave up
buttons(9, color);
Oct += 12;
- wait(1);
+ o++;
+ wait(0.1);
}
}
}
