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:
- 10:ff7cdaeb8b9a
- Parent:
- 9:df3bff3a0b76
- Child:
- 13:f72d45d919b4
diff -r df3bff3a0b76 -r ff7cdaeb8b9a light_pressed.h
--- a/light_pressed.h Mon Feb 10 09:58:37 2014 +0000
+++ b/light_pressed.h Mon Feb 10 11:07:18 2014 +0000
@@ -1,10 +1,11 @@
#include "touch_tft.h"
#include "SPI_TFT_ILI9341.h"
-
+#include "USBMIDI.h"
int slider;
+//extern int Octaves[10] = [-24, -12, 0, 12, 24, 36, 48, 60, 72, 84];
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
@@ -45,69 +46,65 @@
{
if (p.x > 3 && p.x < 78) { //Slider
- if (p.y > 88 && p.y < 111) { //button 1
- slider = 16383;
-
+ if (p.y > 88 && p.y < 111) {
+ slider = 8192;
}
- if (p.y > 111 && p.y < 134) { //button 2
- slider = 14742;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 111 && p.y < 134) {
+ slider = 6400;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 134 && p.y < 157) { //button 3
- slider = 13104;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 134 && p.y < 157) {
+ slider = 4915;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 157 && p.y < 180) { //button 3
- slider = 11466;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 157 && p.y < 180) {
+ slider = 3277;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 180 && p.y < 203) { //button 3
- slider = 9828;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 180 && p.y < 203) {
+ slider = 1638;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 203&& p.y < 226) { //button 3
- slider = 8192;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 203&& p.y < 226) {
+ slider = 0;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 226 && p.y < 249) { //button 3
- slider = 4915;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 226 && p.y < 249) {
+ slider = -1638;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 249 && p.y < 272) { //button 3
- slider = 3277;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 249 && p.y < 272) {
+ slider = -3277;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 272 && p.y < 295) { //button 3
- slider = 1638;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 272 && p.y < 295) {
+ slider = -4915;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
- if (p.y > 295 && p.y < 318) { //button 3
- slider = 0;
- MIDIMessage::PitchWheel(slider);
+ if (p.y > 295 && p.y < 318) {
+ slider = -8192;
+ midi.write(MIDIMessage::PitchWheel(slider));
}
}
if (p.y > 163 && p.y < 238) { //ROW B
if (p.x > 83 && p.x < 158) { //button 5
buttons(5, color);
-
}
if (p.x > 163 && p.x < 238) { //button 6
buttons(6, color);
-
}
}
if (p.y > 243 && p.y < 318) { //ROW C
- if (p.x > 83 && p.x < 158) { //Ocatave down
+ if (p.x > 83 && p.x < 158) { //Octave down
buttons(8, color);
- Oct = Oct - 12;
-
+ Oct -= 12;
+ wait(1);
}
if (p.x > 163 && p.x < 238) { //Octave up
buttons(9, color);
- Oct = Oct + 12;
-
-
+ Oct += 12;
+ wait(1);
}
}
}
