Hi All,
This is all new to me, my only programing experience, prior to a few weeks ago was Basic on Commodore 64.
My reason for programing now is more project driven ( i just need to control some LEDs in a model project but have found this interesting, but before i go to fare down the programing rabbit hole.
Can some please advise if it is possible carry out the below tasks all in one sketch or will i need to have multiple sketches and nanos?
i have learned very quickly delay is not your friend.
What I need to accomplish
is as per below
*Section 1
Pin out 0402 Leds
Pin out 0402 Leds
These alternate should cross fade 1 second
Brightness should be quite low 5%
Button A Pin in 3v or lower (resistor to suit)
Button Task
Cross fade increased to .5 sec
Brightness should be 80%
Section 2
WS2812 (bank 1)
Pin out
NUM_LEDS 12
Button B Pin in 3v (task start stop)
Leds 0 & 11 (12) constant separate task
should flash red 0.25s
should flash White 0.25s
Loop
New Task
Led from 10 to 2
Should flash White to Black sequentially (from Led 10 to led 2) timing set 0.5 sec (but may need to adjust separately of other tasks)
Led 1
This should follow the sequence above action after Led 2 has completed task.
Led 1 should Flash Red (0.5 timing set sec) (but may need to adjust separately of other tasks)
Led 1 should Flash Amber (0.5 timing set sec) (but may need to adjust separately of other tasks)
loop
Section 3
WS2812 Bank 2
pin out
NUM_LEDS 16
Button B Pin in 3v (task start stop)
Starting from Led 15/(16) to led 0
should flash Yellow/ black sequentially
This should be 2 on 2 off chasing sequentially 0.5sec
You can configure each of the patterns you have stated easily as static data in the code. Multi_Blink5_Neo is designed to word in conjunction with the FastLED library to do Neopixel type displays. You will need to modify the code enable/disable sequences based on events but it is easily doable by setting the enabled property of each sequence.
It is very possible. A depends on your hardware skills and or willingness to learn. You will also need to learn how to write non blocking software. I would highly recommend before going any further getting a copy of the Arduino Cookbook, it has just about everything you want to do in it. First skim it then read the sections that apply to your project. There are also some good tutorials and some not so good on line you can watch.
The blinking / fading / leds as a running light etc. is surely doable by a single microcontroller.
What I do not yet understand is some points of your list
Do you mean you have to learn which is the anode / kathode of an SMD 0402 LED?
what is the difference between 2. and 3.
what do you mean with
no idea what this means
what do you mean with
what do you mean with
It might be that this description is sufficient for you as you know all the other details of your project.
You should write an overview about your project.
best regards Stefan
Sounds interesting, and I'm looking forward to seeing you progress with this.
It concerns me that at various points in your list you put 'loop', to be clear: in case you think you do all the things listed above loop within loop, and spend several seconds or minutes or even hours getting from the top of the loop function to the bottom, that's not how it works. The loop function should go round many thousands of times in one second, updating and changing things that need updating and changing as needed. The tutorials already linked to above will help you to understand this, but until that all makes sense to you, you will struggle.
As for how many devices you need, I don't see anything in your list of requirements that can't be done by one processor in terms of processing power, I'm not sure about the numbers of pins you need.
sorry to confuse this is just an overview script of what I need to process
yes using this reference in my o402 is a reference to SMD single leds, so as not to confuse for the digital signal to a smart SMD Led such as WS2812 .
Button reference refers that I need a button/control input on a pin that with a low voltage from an outside source, as I am alternating between 2 separate Leds they will need to be on different pins, appreciated your input
still confusing what you are writing here.
If you use a real and typical button. This button has a contact that is opened/closed through a mechanical force. Electrically this typical button is only connected to the microcontroller and nothing else. The voltage needed for the a typical button comes from the microcontroller. There is no need to connect a typical button to some external voltage supply.
As you are writing about 3V do you talk about some device that is electronically in itself??
To be able to adapt explanations to your knowledge-level
you should write information about how much you know about electronics and programming.
From your postings so far this is unclear SMD numbers might say you know quite a lot about electronics. Some other things make me ask "what is her/his knowledge-level about electronics?
Thanks for taking the time to read my post and follow it is greatly appreciated, I was going to use the button code to read and act on the signal which can be between 5v and 3v
the signal will actually be 12v but a 530ohm resistor should be sufficient to reduce current to something and Arduino can safely accept without risk of any overvoltage. if this is the case I'm open to suggestions hence the post, I have tried a few Arduino AI sites but either my queries are not framed well or the AI still has to be refined more as still keep throwing the delay command even when it is told to not use delay.
A button/switch is only a way to either open/close a circuit, from what I have been able to learn is, that the button command is just checking if there is a signal yes/no and act on the result, depending on the criteria set in the program, I am purchasing a special module.
(https://tenacontrols.com/product/complete-android-bluetooth-controlled-lighting-board-and-system/)
that controls a lot of light functions but I want to put some of my own twist to some of the functions, so will use the outgoing power signal to activate the sequence on the Arduino.
as I said haven't done any programming in over 40year and even then it was in BASIC. simple string loops if-then statements, certified MSCE NT4 not really electronic or programming but makes your brain work in a certain diagnostic way, quite a few years as small engine specialist, so have to work on mower marine and automotive circuits, and most importantly google and youtube are my friends, never be afraid to learn, it can only cost time.
SMD numbers are no special skill only a size of the SMD. An 0402 part is 40 mils (0.040 inches) long and 20 mils (0.020 inches) wide. I will be using a range of SMDs in the project all sizes from 0402 to 1206 some 3mm and 5mm Leds also WS2812 Chip 2020 strips, 1260 SMD COB strips and 5050 light strips.
also i did large Christmas light displays for quite a few years and had over 20,000 leds running.
so, in essence, I'm the proverbial bottom of the pyramid, I know a little bit about a lot of stuff, but what I don't know there is the internet.
Using a current-limiting resistor is not the best method for interfacing 12V-signals
You should use a well calculated voltage-divider.
You linked to the website itself. Do you want to buy
this
module?
or something different.
The device shown in your link is something completely different than a mechanical button!!
So far you have been only partially followed the advice given in the
"how to get the best out of this forum"-tutorial.
Sure there is the internet. And as long as you use website and videos you can do this in every way you want. The interaction with other users in a user-forum is different.
So if you want to proceed quicker than:
doing a quick short posting
waiting 1 hour for an answer where the answer is only asking for left out details
doing a quick short posting
waiting 1 hour for an answer where the answer is only asking for left out details
... repeat repeat repeat repeat repeat repeat repeat repeat repeat
and
if you want the sympathy of the users here read this introductional tutorial and follow the advice as close as you can.
you can program all "tasks" on your own or you can use a library to make things easier for you.
I suggest you start with the a simple program from the IDE "blink without delay". If you got it working and don't want to write much code, have a look at my library:
It offers several LED effects to run in parallel and a simple button.
Furthermore you can mix LEDs on discrete Arduino pins and WS2812 stripes (or several other "port expander" variants).
Thank you again Stefan, for your constructive criticism, I never asked for sympathy,
Please don't take this the wrong way.
My only question was if what wanted to achieve could all be in a single sketch on the same board.
As learning a new programing language including acceptable terms and references will take considerable time.
And I felt it better to go to a lernard a community first and ask if it was possible before I invested time and effort into for all i knew may not have been possible.
Many responded overnight (different time zones, or they don't sleep) with yes it is possible.
I did not ask for anything more. and was considering my options on the positive responses I received, while reading during my break at work. and had decided that i would investigate all i could on this site when I had time to review and take it in and experiment some more, you polity asked questions, and in turned answered as best i could at the time.
In the end a nano is only $3.50ea from Aliexpress and could easily just run 3 boards, $11 wont kill me on the project, I asked the question because it seemed wasteful and a bit of a fun challenge.