I built a (foot)controller to send midi messages via bluetooth to usb port of my guitar multifx and at a later time I wanted to add a 7-segment display to view the counter of the selected effect.
Unfortunately, in the sketch, after inserting
#include <SPI.h>
#include <Usb.h>
#include <usbhub.h>
#include <usbh_midi.h>
USB Usb;
USBH_MIDI Midi (& Usb);
the presence of the code
If (Usb.Init () == -1) {while (1);}
causes problems in displaying 7-segment display digits.
The display is this https://tinyurl.com/ku3cojj ( 2 digits in one )
The problem appears if i connect the 7 segments between pin 5 and pin 11 (driving digit 1 with pin 12 and digit 2 with pin 13), and at that point the digits are not well distinguished because the segments that should remain turned off remain turned on. Unfortunately, pins 0,1,2,3,4 are used for other purposes and I can only use from 5 to 13.
I tried to remove all the "include" mentioned above but only with the presence of the code
If (Usb.Init () == -1) {
While (1);}
the digits display is faulty !
However, if I disable the code
If (Usb.Init () == -1) {
While (1);}
i have no problems with the display BUT the controller does not work :-D
Can it be solved ?
Thanks in advance !
Unfortunately, in the sketch, after inserting
#include <SPI.h>
#include <Usb.h>
#include <usbhub.h>
#include <usbh_midi.h>
USB Usb;
USBH_MIDI Midi (& Usb);
the presence of the code
If (Usb.Init () == -1) {while (1);}
causes problems in displaying 7-segment display digits.
The display is this https://tinyurl.com/ku3cojj ( 2 digits in one )
The problem appears if i connect the 7 segments between pin 5 and pin 11 (driving digit 1 with pin 12 and digit 2 with pin 13), and at that point the digits are not well distinguished because the segments that should remain turned off remain turned on. Unfortunately, pins 0,1,2,3,4 are used for other purposes and I can only use from 5 to 13.
I tried to remove all the "include" mentioned above but only with the presence of the code
If (Usb.Init () == -1) {
While (1);}
the digits display is faulty !
However, if I disable the code
If (Usb.Init () == -1) {
While (1);}
i have no problems with the display BUT the controller does not work :-D
Can it be solved ?
Thanks in advance !