stoo Posted February 5, 2023 Author Posted February 5, 2023 On 05/02/2023 at 18:45, DaveHx said: Okok, thank you stoo, i checked every switch, every pin and every single wire, everything is fine, and now something changed, when I press the switch for change the page it work! But not the single switch 😮💨 but at the least something on the switchpin work! I noticed even something strange when I open Serial Monitor, "recvRetCommandFinished ok recvRetCommandFinished ok recvRetCommandFinished err" And i don't understand what it means 😅 Expand the "recvRetCommandFinished" messages look to be something that the Nextion library generates... (see line 187 here - https://github.com/itead/ITEADLIB_Arduino_Nextion/blob/master/NexHardware.cpp) - looks like it's probably a message from the Nextion back to the Arduino to say that it's recieved a command and confirm it's completed it OK. I'm not sure why the 3rd one reports an error - it doesn't give much information to go on - but the first two report as "ok"... so I would think the basic communication between your Arduino and Nextion is probably OK. If your footswitches can change the page on the Nextion - then you've definitely got communication between the footswitches and the Arduino, as well as between the Arduino and Nextion..... so you're most of the way there now! Next thing to investigate is the MIDI connection to the HX... 1 Quote
DaveHx Posted February 5, 2023 Posted February 5, 2023 Ok I will investigate about, maybe can be the compatibility of my Nextion? I use an NX3224k028 but probably not, on the datasheet it's basically the same a part for the pixel 320x240 so 🤔 btw thank you stoo! Quote
DaveHx Posted February 7, 2023 Posted February 7, 2023 (edited) so, maybe, but maybe and i don't know yet, i found the problem! i saw when i charge the sketch on Arduino this kind of message for every single midi message CC PC and other, but always on midi, soooo i think this errors can compromise the normal functioning of the midi side... so did you have any idea of how i can fix it? by the way i'm sure the midi connection are absoltely ok (wiring i mean), thank you man i am so really grateful for your help Edited February 7, 2023 by DaveHx Quote
stoo Posted February 7, 2023 Author Posted February 7, 2023 On 07/02/2023 at 18:28, DaveHx said: so, maybe, but maybe and i don't know yet, i found the problem! i saw when i charge the sketch on Arduino this kind of message for every single midi message CC PC and other, but always on midi, soooo i think this errors can compromise the normal functioning of the midi side... so did you have any idea of how i can fix it? by the way i'm sure the midi connection are absoltely ok (wiring i mean), thank you man i am so really grateful for your help Expand I don't think that'll be it.... It's a warning that I've sent a "string" type value as an argument to a function that has a "char*" type value as its parameter. This is something that used to be allowed - it didn't throw up any errors for me when I built my one 3 years ago. They've since changed the rules.... but I think this is still just a warning that can be ignored. Not totally certain - but I can't easily test with mine at the moment to confirm.... What you could do to test your MIDI output is to use some simpler code that tests only the MIDI output part... I think something like this should work... If it does, it will just change back and forth between 2 presets every second #include <MIDI.h> MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI); void setup() { MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to all incoming messages } void loop() { if (MIDI.read()) // If we have received a message { MIDI.sendProgramChange(1, 1); // Send a PC1 on channel 1 delay(1000); // Wait for a second MIDI.sendProgramChange(2, 1); // Send a PC2 on channel 1 delay(1000); // Wait for a second } } Quote
stringvelocity Posted February 10, 2023 Posted February 10, 2023 On 04/03/2019 at 14:18, stoo said: I should give credit to this page which got me started - https://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/?fbclid=IwAR12ACoLLPoNWdAcU10XtLe20754FsPWR3Ffv_nYVFiUoo-TNrgJib0AnT4 If you want to understand more about how it all works, it's a good place to begin. I also got a fair bit from various pages on the arduino forum ( http://forum.arduino.cc/index.php ) which I didn't think to save as I went.. Expand Is there a way in your code to set a couple of buttons to toggle? Quote
DaveHx Posted February 10, 2023 Posted February 10, 2023 On 07/02/2023 at 22:30, stoo said: I don't think that'll be it.... It's a warning that I've sent a "string" type value as an argument to a function that has a "char*" type value as its parameter. This is something that used to be allowed - it didn't throw up any errors for me when I built my one 3 years ago. They've since changed the rules.... but I think this is still just a warning that can be ignored. Not totally certain - but I can't easily test with mine at the moment to confirm.... What you could do to test your MIDI output is to use some simpler code that tests only the MIDI output part... I think something like this should work... If it does, it will just change back and forth between 2 presets every second #include <MIDI.h> MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI); void setup() { MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to all incoming messages } void loop() { if (MIDI.read()) // If we have received a message { MIDI.sendProgramChange(1, 1); // Send a PC1 on channel 1 delay(1000); // Wait for a second MIDI.sendProgramChange(2, 1); // Send a PC2 on channel 1 delay(1000); // Wait for a second } } Expand it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo! Quote
LukeFRC Posted February 10, 2023 Posted February 10, 2023 I suppose I can post this in here.... I made a simple USB-host midi switcher for my Source Audio C4 using an Adafruit trinket m0 and some code I found on Github! 5 Quote
LukeFRC Posted February 10, 2023 Posted February 10, 2023 On 10/02/2023 at 11:47, LukeFRC said: I suppose I can post this in here.... I made a simple USB-host midi switcher for my Source Audio C4 using an Adafruit trinket m0 and some code I found on Github! Expand it lets me switch through the 127 different presets 3 Quote
EBS_freak Posted February 10, 2023 Posted February 10, 2023 Those trinkets are great! I do love an Arduino project. My latest is a foot controller for online presentations, controlling multiple cameras angles, camera sliders, teleprompt control, lighting controls, mute (of course!) bringing in graphics on screen (via key/fill) and stepping through presentations/infographics etc. Total tap dancing work out but it's pretty ace. One man band television studio! (But great for my online conference stuff - keeps my hands free (I do a lot of talking with my hands!)) 2 Quote
stoo Posted February 10, 2023 Author Posted February 10, 2023 On 10/02/2023 at 00:08, stringvelocity said: Is there a way in your code to set a couple of buttons to toggle? Expand Yep - look at the looper fwd/rev button part as an example Quote
stoo Posted February 10, 2023 Author Posted February 10, 2023 On 10/02/2023 at 11:38, DaveHx said: it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo! Expand Ignore the nextion for now. You've already shown that you have that part working and communicating with the Arduino. If you don't have the midi output part working correctly, any further testing with the nextion is impossible as you have no way of knowing if its doing anything. On my switcher, I can press the FS1,FS2,FS3 etc buttons on either the screen or the actual footswitches..... And if the midi cable is not correctly connected, nothing will happen. There is no visual indication on the screen to confirm the button press. Quote
stoo Posted February 10, 2023 Author Posted February 10, 2023 Aaaah - just found a link to someone who has had some success decoding the usb communications between stomp and hx-edit. I think I saw them mention it before on Facebook but never saw any further details. There's a link to some stuff on GitHub and their demo with an FBV3 - https://line6.com/support/topic/60839-another-lockdown-project-talk-to-your-hx-stomp-over-usb/ Guess I might have to start work on a v3 controller with scribble strips and RGB footswitch LEDs.... 1 1 Quote
DaveHx Posted February 10, 2023 Posted February 10, 2023 yup but the electronic connection are ok even because i used the tra cable for the midi connection i checked the pin on the Midi connector and everything is ok, i put the 220 ohm resistor on 5 volt and 220 on tx cable so for this reason i was thinking there was a problem with the screen cause is the only different thing from your project 🥴 and i mean i made a switcher before with the ssd1306 and it worked a lot! 🙄 but just for ask, on serial monitor here on arduino IDE i don't have the possiility to check if it work? On 10/02/2023 at 13:23, stoo said: Ignore the nextion for now. You've already shown that you have that part working and communicating with the Arduino. If you don't have the midi output part working correctly, any further testing with the nextion is impossible as you have no way of knowing if its doing anything. On my switcher, I can press the FS1,FS2,FS3 etc buttons on either the screen or the actual footswitches..... And if the midi cable is not correctly connected, nothing will happen. There is no visual indication on the screen to confirm the button press. Expand Quote
stoo Posted February 11, 2023 Author Posted February 11, 2023 On 10/02/2023 at 20:47, DaveHx said: yup but the electronic connection are ok even because i used the tra cable for the midi connection i checked the pin on the Midi connector and everything is ok, i put the 220 ohm resistor on 5 volt and 220 on tx cable so for this reason i was thinking there was a problem with the screen cause is the only different thing from your project 🥴 and i mean i made a switcher before with the ssd1306 and it worked a lot! 🙄 but just for ask, on serial monitor here on arduino IDE i don't have the possiility to check if it work? Expand I don't understand why you are so confident that you've got everything correct with the midi output.... If that was the case, then the simple midi output test sketch I posted should change presets on your HX..... Been a while since I used serial monitor, and i only used it on the default serial port.... Arduino Mega has several, so you may need to change the monitor to the one used for the midi output... Not sure if that's possible - not in front of a computer to check Quote
DaveHx Posted February 12, 2023 Posted February 12, 2023 On 11/02/2023 at 09:32, stoo said: I don't understand why you are so confident that you've got everything correct with the midi output.... If that was the case, then the simple midi output test sketch I posted should change presets on your HX..... Been a while since I used serial monitor, and i only used it on the default serial port.... Arduino Mega has several, so you may need to change the monitor to the one used for the midi output... Not sure if that's possible - not in front of a computer to check Expand Sooo, i checked again everything on the circuit, even i re make all the connection on the board, TX2 with 220 ohm resistor goes on pin n5 ground on pin n 2 and 5v with 220 ohm resistor goes on pin n4 but nothing happen yet... i'm totally confused, maybe because i use the usb to turn on the switcher? (Not conmected on the pc but only to a normal usb smartphone charger i mean!) Quote
tauzero Posted February 12, 2023 Posted February 12, 2023 On 10/02/2023 at 11:38, DaveHx said: it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo! Expand If the baud rate is controlling the MIDI port baud rate, it's wrong. Needs to be 31250. Quote
DaveHx Posted February 12, 2023 Posted February 12, 2023 Nope, the baud rate on this screen shot refer on the nexSerial to comunicate with arduino, but there's another baud rate on set up serial.begin(250000) On 12/02/2023 at 01:28, tauzero said: If the baud rate is controlling the MIDI port baud rate, it's wrong. Needs to be 31250. Expand Quote
DaveHx Posted February 12, 2023 Posted February 12, 2023 Oh god yessss it work 🥳🥳🥳🥳🥳 i don't know even what I do 😆 just makes all the ground again 🫣 thanks for everybody gives me help 🥳🥳🥳🥳 i just only have one question, how i can use the other two pages? Just because I want to use a relay for switch the od on or bypass, but really thank youuuu🤩🤩🤩🤩 1 Quote
stoo Posted February 12, 2023 Author Posted February 12, 2023 On 12/02/2023 at 18:16, DaveHx said: Oh god yessss it work 🥳🥳🥳🥳🥳 i don't know even what I do 😆 just makes all the ground again 🫣 thanks for everybody gives me help 🥳🥳🥳🥳 i just only have one question, how i can use the other two pages? Just because I want to use a relay for switch the od on or bypass, but really thank youuuu🤩🤩🤩🤩 Expand Nice one! Frustrating that you don't know exactly what the issue was - hopefully just a loose connection that needed to be reseated. What's the issue with the other pages? Sorry - I don't understand your question..... 1 Quote
DaveHx Posted February 13, 2023 Posted February 13, 2023 On 12/02/2023 at 19:17, stoo said: Nice one! Frustrating that you don't know exactly what the issue was - hopefully just a loose connection that needed to be reseated. What's the issue with the other pages? Sorry - I don't understand your question..... Expand sorry, maybe was the euphoria of the moment 😆 i just want to go on the other two NexPage(program_page and Other_Page) , but i see here i can change only the menu on the main page with the switch, i need to push the combo for the Macro, right? again thank you stoo for you patience 😁 Quote
stringvelocity Posted February 14, 2023 Posted February 14, 2023 On 10/02/2023 at 13:17, stoo said: Yep - look at the looper fwd/rev button part as an example Expand How would I go about making a button or buttons programmable? Quote
stoo Posted February 14, 2023 Author Posted February 14, 2023 On 13/02/2023 at 01:28, DaveHx said: sorry, maybe was the euphoria of the moment 😆 i just want to go on the other two NexPage(program_page and Other_Page) , but i see here i can change only the menu on the main page with the switch, i need to push the combo for the Macro, right? again thank you stoo for you patience 😁 Expand Ah ok I see... The extra pages in the Nextion file were just a placeholder for future functionality that I intended to implement. I had initially planned to make everything re-programmable from the touchscreen without needing the computer...... But once I got the first prototype built and working, I found I didn't need to reconfigure the pages and so didn't do any more work on that functionality. Quote
stoo Posted February 14, 2023 Author Posted February 14, 2023 On 14/02/2023 at 01:49, stringvelocity said: How would I go about making a button or buttons programmable? Expand That would require some extra code to be written to support it.... As mentioned above, I had originally intended to, but found I didn't need it.... And so that part never got finished. Feel free to have a go though! Quote
stringvelocity Posted March 7, 2023 Posted March 7, 2023 (edited) Is there a code I can add to have led light to indicate what page I have switched to instead of a led screen? Edited March 7, 2023 by stringvelocity Quote
stringvelocity Posted March 10, 2023 Posted March 10, 2023 On 14/02/2023 at 15:24, stoo said: That would require some extra code to be written to support it.... As mentioned above, I had originally intended to, but found I didn't need it.... And so that part never got finished. Feel free to have a go though! Expand How would you code 2 led lights instead of a screen to indicate page one or two? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.