is anyone here any good with arduino?

Started by njkmonty, June 13, 2018, 01:57:42 AM

Previous topic - Next topic

njkmonty

i have a project which was shared with me to make a  arduino style " gigrig / switcher/ octoswitch'
the very generous person who shared the info and code with me , is very busy and I dont wont to bug them anymore than i have




Ive managed to build the exact build as in the above video  no probs, aswell as slightly modify the code to adjust simple things like names etc on lcd.

basically what im wanting to do is add a few more loops  , after talking with the gent , i discovered adding an extra 4 loops isnt too difficult as there are 4 unused buttons ready to go in his matrix.

https://www.dropbox.com/home?preview=GuitarSwitch-DJ-v0.14.ino.ino
its adjusting the code and adding extra leds to the 2C IO addresses etc   

I was hoping maybe someone here could assist with the code.. what i was hoping to do was tidy up the project so it may be easily to duplicate , even for the arduino novice


I dont want more presets  as there are 8 and a few banks.
its just increasing the 8 loops  to 12

https://www.dropbox.com/home?preview=GuitarSwitch-DJ-v0.14.ino.ino




potul

I can try to help here. I have built some similar projects in Arduino

I tried your dropbox links but they don't seem to work.

Mat

marcelomd

Hi,
Same here. I can help, but the link is not working.

njkmonty

it worked again for me   strange?

ill try again

https://drive.google.com/open?id=16SY26Y6RVW-sLZRdTiOEHgrkdQHR5cz7



there should be a multipage excel spreadsheet  info regarding  parts etc
the arduino sketch
lcd library




potul

Ok, now it works.
Do you have any schematic? It's hard to understand without knowing how everything is connected

njkmonty

there is a img of partial connection  in the download  link  i will see if i can come up with a more detailed one

https://photos.app.goo.gl/JW1cvT2MF4cGsLzS6

Ben N

Hah! Patrick recently shared his code, etc. with me as well, but I haven't gotten to the project yet, and have since bought a Decibel 11 Switch Dr. (they are on clearance at the Decibel 11 website). Still, I am very interested in following your progress. Please keep us updated!
  • SUPPORTER

njkmonty

#7
ive added some more files to the google download



the 9OL,10L,11L, and 12L    switches   are the extra 4  i want to add

https://s5.postimg.cc/vvnq71pz9/schematic.png





potul

So, from your info I get that:

-You have 24 buttons arranged as an array of 12x2 (originally 20, you want to add 4)
-You have 16 LEDs using 2 I2C expansion modules
-One LCD using I2C as well
-You have 8 relays adressed directly with I/O pins.

Now the questions:

-Why both I2C I/O expansion LEDs are connected differently? (one is comon ground, the other is commond V+). Any reason for this?
-If I understand you want to add 4 more loops. You have 4 more buttons available in the kaypad matrix, so this should not be a big deal, but you need as well to add 4 LEDs and 4 Relays. Where do you plan to attach them?







r-nox

#9
Start looking at these lines and hope you have enough pins


137

165

296

Transmogrifox

Use github or similar if you're going to do very much code collaboration.  Dropbox and Google drive are generally less accessible by people behind a corporate firewall.  Also github and the like are made for this kind of thing.

For example, sometimes I may have a chance to play with something like this over my lunch break at work, but then I can't access stuff on dropbox and google drive so I go and do something different for lunch break.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

njkmonty

ok i wil give Github a go..

just created a github account but getting a little confused!

Quote-Why both I2C I/O expansion LEDs are connected differently? (one is comon ground, the other is commond V+). Any reason for this?

for some reason when i did all leds to ground they  the preset leds would be on off state  when suppose to be on?    its not a huge issue at this stage as my temporary work around has it working , however it may be due to something else.


Quote-If I understand you want to add 4 more loops. You have 4 more buttons available in the kaypad matrix, so this should not be a big deal, but you need as well to add 4 LEDs and 4 Relays. Where do you plan to attach them?

yes the 4 extra momentary switche (loops 9-12)  appear to working on the arduino board , ie the onboard  led is recognising them when pressed ,

what i was hoping to do is add another 4 leds corresponding to the loops 9-12, however i assume code would be needed to add these and another i2c board in series?

im a newbie to arduino    i managed to put this project together by simply trial and error and using Patricks google online pictures to put it together!



this was the last correspondace from Patrick on how to modify his project code to my needs as described....

QuoteYou should be able to change the code so you can add physical buttons that I left out on my version.

In the keypadEvent() subroutine there is a switch (key) section, you can add some handlers like you see below:

           case 't':
            handleLoopKeyEvent(7);
            break;
           case 'u':
            handleLoopKeyEvent(8);
            break;
           case 'v':
            handleLoopKeyEvent(9);
            break;
           case 'w':
            handleLoopKeyEvent(10);
            break;
           case 'x':
            handleLoopKeyEvent(11);
            break;


You do however have to modify the memory routines for storing and retreiving the values. The handling of the loop leds also requires rework (setLCDChannel()).


QuoteThe jumpers need to be in a specific position because it represents the I2C bus address. In the code you can see the following statements:
// Set I2C IO addresses
#define IO_ADDR_Presets 0x38
#define IO_ADDR_Loops 0x39
So the preset leds are using address 0x38 and the loop leds are using address 0x39.

Typically only one preset LED is active, only when storing a preset they will all blink at the same moment. Or when you hold the mute button for a few seconds all led's start flashing.
So it looks like you inverted the LED's, did you wire them from the expension board through a resitor to ground of to +5Volt?

To test if it works correctly you can revert the addresses in the code of revert the jumpers on the expansion boards and see what the led's do.

Regards,

Patrick.


potul

Quote from: njkmonty on June 15, 2018, 12:23:00 AM

what i was hoping to do is add another 4 leds corresponding to the loops 9-12, however i assume code would be needed to add these and another i2c board in series?



Yes, probably this should work. But take into account you need as well 4 more relays. Do you have available I/O pins in the arduino?

There are at least 3 things to be done to modify the code for the added loops:

-Add the new loops to all the relevant functions (updating the LEDs and relays, etc...)
-Create the handle of the new buttons
-Modify the memory routines that store/recall presets. This will be tricky because now there is one byte (8bits) used to store the loops. We will need an extra one, so you will have less presets available depending on the arduino memory.



njkmonty

i have plenty of relays   thats not a problem, the relay module in my pics is just to use to see if it works , i will be using dpdt relays for all loops
im also using an Arduino mega 2560 board   and have heaps of digital  i/o   available   i count at least 18  unused.

here are some specs of board im using

Microcontroller   ATmega2560
Operating Voltage   5V
Input Voltage (recommended)   7-12V
Input Voltage (limit)   6-20V
Digital I/O Pins   54 (of which 15 provide PWM output)
Analog Input Pins   16
DC Current per I/O Pin   20 mA
DC Current for 3.3V Pin   50 mA
Flash Memory   256 KB of which 8 KB used by bootloader
SRAM   8 KB

potul

Quote from: njkmonty on June 15, 2018, 03:57:59 AM
i have plenty of relays   thats not a problem, the relay module in my pics is just to use to see if it works , i will be using dpdt relays for all loops
im also using an Arduino mega 2560 board   and have heaps of digital  i/o   available   i count at least 18  unused.

Ok, this makes things easier. In theory, you could also use these spare I/O for the LEDs and avoid the extra I2C module, but this would require a little more code changes.


njkmonty

yeah  i dont care how it looks   and if the other leds go into the i2c thingy or not,    i would like as many more loops as i could fit!

potul

#17
I'm trying to compile your code without success, getting some errors due to the keypad library

Can you tell us what keypad.h you used?


Forget it, I got it working....

njkmonty

all i used was the LCD library Patrick supplied,
  and then just downloaded the keypad library through the arduino sketch program..
took me a while to figure out you need libraries!

Transmogrifox

Quote from: njkmonty on June 15, 2018, 12:36:15 AM
https://github.com/njkmonty/GuitarSwitch-DJ-v0.14.ino/blob/master/GuitarSwitch-DJ-v0.14.ino.ino

im not sure if i did it right???      is this what you wanted???
Perfect.  That makes it easy to access.  Now maybe I can take some time to catch up to this thread and look at the code.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.