Has anyone ever looked into an emulator of sorts?

Has anyone ever looked into an emulator of sorts? I was thinking about how my roommate and I could quickly test different patterns that we have created in an Arduino IDE. I was thinking we could just compile and run it in some sort of test environment instead of having to upload it to the Arduino itself and then connect the strip.

I am picturing the ability to create whatever physical LED setup you have and then see what your code/pattern will look like without having to hook up the strip to the arduino.

Does anything like this exist, or does anyone have any idea of how to create that?

Yes - https://plus.google.com/u/0/communities/109127054924227823508/s/emulator — there’s been some conversation about it - short version is, it’s on the list of things I’d love to do if I get time, but I have no idea when that would be (given how much else is on that list) - and I have a vague memory of someone having written a simple one, but no idea offhand what the state of it is. Maybe this? https://plus.google.com/+MarcMillerTime/posts/EqtaXt8DPGw

@Adam_Wright The emulator I made (which I saw you discovered) still requires uploading the code to your MCU. So it’s not stand alone, but you don’t need any LEDs hooked up to see your patterns. It would be nice to not need the MCU for testing, but by requiring the MCU to be part of the emulation it forces a check that your program is indeed actually going to run on your hardware, and if you have buttons or potentiometers you can test that as well.

I’ve been envisioning a gui of sorts to do the opposite… You pick a pattern (almost undoubtedly from a small subset of more defined animations vs. everything fastLED could do), it generates the requisite code.

related to the last idea, I would suggest not to generate code but to have fixed code which accepts a lot of parameters, e.g. in a kind of configuration tree (XML, JSON, etc.) that defines patterns to use, with parameters, maybe timings, etc.) but I have put this idea to the side myself on concentrated on the MIDI sequencing first because it better fits to my setup.

What this would ultimately be is a LED sequencer similar to Vixen or Glediator, or much more advanced, Madrix3, but with the difference that it does not send “images” to the strip and use FastLED simply as framebuffer, but instead does all the drawing on the MCU. However I would imagine that this could be a monster project…

@Daniel_Garcia Thanks for the response. I guess I should have searched the community’s existing posts, but I was unsure of whether my search terms would be descriptive enough.

@marmil That is pretty much what I was thinking about. I would prefer trying to eliminate the MCU from the process, but I do see the advantage in including it if you are trying to test some external input from a pot or other controller.

@Sebastian_Stuecker I watched the video in your post. I would have to investigate your setup further to understand what exactly you are doing, and then what you are suggesting with the configuration tree.

Can any of you suggest a process to make my idea possible? I’ve been looking for a project like this to work on, but I am unsure which direction I should dive deep into first.

I suggest you clearly seperate emulation the LED strip(s) and emulating the actual MCU including the library.

You shoudl list what functions you would actually like to achieve and what value that has. For emulating the LED strip thats probably easy:

  • being able to experiment without an actual LED strip including power supply etc.

  • test of code that will actually work on the MCU including the timing, etc (therefore you would probably use an MCU for it)

The usecase for the other part seems to be pretty different:

  • having a GUI to easily sequence predefined LED patterns
  • seeing a visual representation of how it will look like - but that does not have to be precise - could also have a live preview by directly communicaiton to the MCU while using the sequencer (as in Vixen)
  • Using more than one animation at the same time - either on seperate parts of the strips or blended together with (maybe different kinds of) blending functions. Maybe a fixed number of channels that can be mixed together (this may consume a lot of memory and CPU time)
  • Each animation would have a set of parameters , like hue, brightness, speed, direction, etc - some of the parameters might apply to most animations, some might be specific
  • Some animations would typically loop, some might be one-shot effects
  • It would be good to “animate” parameters (e.g. increase the speed over time, etc.)
  • THe final “composition” might be modifieable - e.g. adding glitter, strobe, etc. effects, those can be applied to any animation.

All in all a very comprehensive project. I would not be qualified at all to dive into the GUI part of all of that, so this is why I am trying to think about how this could be done just using configuration files, parameter sets, etc - I am not even sure myself how this would have to look like. This is why I am right now looking into this MIDI stuff. There are already MIDI sequencers out there, freeware, and they do something similar, they send different tones, with different velocities, and instruments over time. By trying to see the LED strip as an instrument I am trying to use something that is already there.