aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rwxr-xr-xmain.c55
2 files changed, 57 insertions, 2 deletions
diff --git a/README.md b/README.md
index 891af65..85128d6 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
#Overview
-The idea here is to create a lufa based midi framework for use on the stock usb capable arduino. The goal is twofold:
+The idea here is to create a lufa based midi framework for use on the stock usb capable arduino and other atmega32u4 boards. The goal is twofold:
1. to isolate the lower level usb functions from the actual programs
@@ -46,7 +46,7 @@ A minimal sysex handler, called by either the maintainence tasks or by MidiEvent
This handler should also buffer sysex's that are not directed at the target.
###Hardware Abstractions.
-Some of the work involved with the LUFA library is to provide feedback for the states of the the usb connection itself. This requires a hardware abstraction for each board supported by the library. In our use case this would better be served by providing weak functions to be overridden user functions.
+Some of the work involved with the LUFA library is to provide feedback for the states of the the usb connection itself. This requires a hardware abstraction for each board supported by the library. In our use case this would better be served by providing weak functions to be overridden by user functions.
diff --git a/main.c b/main.c
new file mode 100755
index 0000000..11d70c4
--- /dev/null
+++ b/main.c
@@ -0,0 +1,55 @@
+/*
+
+
+ */
+
+#include "USBMidiTransport.h"
+#include <util/delay.h>
+
+/** LUFA MIDI Class driver interface configuration and state information. This structure is
+ * passed to all MIDI Class driver functions, so that multiple instances of the same class
+ * within a device can be differentiated from one another.
+ */
+
+volatile uint8_t myMidiChannel=DEFAULT_MIDI_CHANNEL;
+volatile uint8_t myMidiDevice=DEFAULT_MIDI_DEVICE;
+volatile uint8_t myMidiCable=DEFAULT_MIDI_CABLE;
+volatile uint8_t myMidiID[]={ARDUINO_MMA_VENDOR_1 ,ARDUINO_MMA_VENDOR_2,ARDUINO_MMA_VENDOR_3};
+volatile uint8_t mySysexBuffer[MAX_SYSEX_SIZE];
+volatile uint8_t mySysexBufferIndex;
+
+/** Main program entry point. This routine contains the overall program flow, including initial
+ * setup of all components and the main program loop.
+ */
+void initBlinkingLights(void);
+void initBlinkingLights(void){
+// DDRB=0xff;
+ PORTB=0x0f;
+ _delay_ms(1000) ;
+ PORTB=0xf0;
+ _delay_ms(1500) ;
+ PORTB=0x0f;
+ _delay_ms(1000) ;
+ PORTB=0xcc;
+ _delay_ms(1500) ;
+ PORTB=0xff;
+ _delay_ms(1000) ;
+ PORTB=0x00;
+ _delay_ms(1500) ;
+
+
+}
+
+int main(void)
+{ DDRB=0xff;
+InitializeUSBMidi();
+
+ InitializeUSBMidi();
+
+ for (;;)
+ { initBlinkingLights();
+
+ USBMidiEventAvailable();
+ }
+}
+