Hi
I’m new to programming arduino code and am trying to make my hazard lights and turn signals run off the same unit, I can make each circuit separately but not together. The picture shows a button that when pressed turns the hazards either off or on which is coded to the uno and the two attiny’s are the left and right turn signals running the blink code.
What is the purpose of the ATtinys ?
UKHeliBob:
What is the purpose of the ATtinys ?
I suppose they are hold in reset state until the central unit raises a condition - then they do their work independently of the central unit until the central units put them in reset state again.
Such Distributed system design comes at a cost of extra and unnecessary hardware but helps minimize complexity and scaleability by adding a 'brain' close to the action, simplifying commands and letting multiple teams work on each subsystem independently.
The "team" in charge of the turn signal basically is instructed to develop a self contained unit with a lamp that blinks when the processor is running. they don't need to know anything else. Then it's plug and play, bring 1 signal cable + power and you're good to go.
The "team" in charge of the central unit just needs to know that in order to operate the turn signal they need to raise a pin for the duration of the signal and they don't have to worry about anything else
In more complex cases that helps also protect Intellectual Property as no one team as the full source code or you can work with subcontractors whilst minimizing risks.
(of course such design does not guarantee - unless you provide additional guidance to the "turn signal team" - that the blinking will be synchronous if you have 2 blinkers being triggered at the same time.. should kinda work but there is no sync between the 2 subsystems)
Sorry my question is
How to program it so
-
A button on the transmitter acts like the button in picture (which i think if i run the 5v and gnd and pin7 to a channel on receiver will run the hazard lights. Yes/no? As the picture just shows the hazard circuit)
-
How to add the blink codes for the left and right turn signals to the uno instead of using the two ATtinys. I will eventually have these as self canceling turn signals turned on by transmitter and off when the wheels go back past centre,
-
Would the hazard lights and both turn directions run off one ATtiny? Would that be 3 separate codes on the ATtiny?
Ive had no problem in finding or writing the codes its just adding them to one unit so they run correctly together.
UKHeliBob:
What is the purpose of the ATtinys ?
the ATtinys have the blink code as i did one turn signal first without the uno then added the other side and put a on/off/on switch in between and when i added the hazard code with the uno I couldn't get then to run, no matter which turn direction i inputted the hazards would go. Something to do with my unthought out wiring I'd say.
Thanks
I suppose they are hold in reset state until the central unit raises a condition - then they do their work independently of the central unit until the central units put them in reset state again.
etc, etc
I get all that and I am familiar with the principle but I wonder if that is the reason for the OP using them. Synchronising them, if required, is going to be interesting