Linking 2 touch lamps circuits


Complete newbie here so apologies for the ignorance.

I'm making a touch lamp.
Picture a 6 foot tall obelisk shaped spike. The top bit also can be removed, both parts have a strip of LED lights. Its going to be touch dimmable and the main part is powered by a plug, and the top part gets it's power from a rechargable battery when it is removed.

Arduinos are new to me, and also general electronics.
But after giving myself a crash course the setup I'm looking at will be something like this-

Everything will be 12v.
The LEDs will be 5630/5730 diodes, warm white, 120/metre.
One arduino in the bottom circuit.

Then the top circuit will have some kind of metal pads that contact for when the top part is put back on.
This top circuit will have it's own arduino.
The battery will be a lithium rechargable battery with some kind of protection to stop power going to it when it's full.

If I was doing one simple circuit I think I could do that with information on this site and youtube.
But I'm not sure how to go about this project.

When the two parts are together I want the touch to switch both lights on.
Hold the finger on the lamp to cycle brighter.
Take the top part off and the lights stay as they are.
And now the circuits work separately.

When the top part is put back on I think I want it to match whatever state the bottom light is at. Haven't decided on this yet though.

The actual conductive touch sensitive part for the bottom bit is at it's top. And vice versa for the top, its touch sensitive bit is at it's bottom half.
This is for practical reasons, one being so the top bit can be taken off without changing the state of the top light.

If you guys have any advice or links to a similar project I am all ears.
I have no experince in coding but want to learn.

Does making two arduinos in seperate circuits work this way come down to the crorect coding?

Thanks again for any advice.

Turn Your description into electrical/coding terms and use the magnifier symbol up to the right in this window.
Attach code and wiring digram.

Complete newbie here so apologies for the ignorance.

Ignorance excused. Seems a bit of a hard project for someone new. I suggest you need to learn the basics first, there are plenty of tutorials, please work through them. Don't be caught out by the very first tutorial that teaches you to use delay();.

Please study blink without delay, which is in the examples in the IDE under digital and apply the lessons learnt to your code. Delay might work OK in simple code, but the more complex your code gets the more delay will cause you problems.
Also study
Using millis for timing
Demonstration for several things at the same time
In answer to the question "my code is not very responsive and I don't know why", which you will be asking in a month or 3; "It's because of all the delays".

Good luck and have loads of fun learning :slight_smile: