Jump to content

idea/request led_mode=


Zam
 Share

Recommended Posts

Hi

Just an idea, not a real need (but it can be fun, and i will use it for sure)

something like a led_mode=blink for .NGC with associate parameter blink:on:100:off:300 for time in ms for each led state?

or defined time with 2 value map

or just 3 "blink" predefined mod, blink_slow, blink_mid, blink_fast

Anyway, the idea is to have a blinking led function when led is on, because a NGR script (set led and delay) is stopped a soon as another section is called

Best

Zam

Link to comment
Share on other sites

  • 1 month later...

Hi, I come back with this.

Nobody interested? Or I miss some NG strategy already available to perform this?

I'm just thinking out loud, but maybe it's possible to use the dimmed= with very slow PWM setting, if the frequency is not locked by the sr clock ?

Best

Zam

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

I created some metas by myself already. So aren't you able to create a meta, that switches an LED (which is part of the meta-event) on and off with a delay of x-ms? I don't see why this shouldn't work... but I never tried it by myself... you could even add the delay to the meta-message. It's very easy to set up. You just have to edit the mios32_event.c and .h. You can use an already existing meta as example.

Edited by FantomXR
Link to comment
Share on other sites

Hi

At mios32_timestamp.c

does this can be used ?

/////////////////////////////////////////////////////////////////////////////
//! Use this function to get the delay which has passed between a given and
//! and current timestamp.
//!
//! Usage Example:
//! \code
//!   u32 captured_timestamp = MIOS32_TIMESTAMP_GetDelay();
//!   // ...
//!   // ... do something ...
//!   // ...
//!   u32 delay_in_ms = MIOS32_TIMESTAMP_GetDelay(captured_timestamp);
//!   MIOS32_MIDI_SendDebugMessage("Delay: %d mS\n", delay_in_ms);
//! \endcode
//! \return the delay between the given and the current timestamp
/////////////////////////////////////////////////////////////////////////////
s32 MIOS32_TIMESTAMP_GetDelay(u32 captured_timestamp)
{
  // will automatically roll over:
  // e.g. 0x00000010 - 0xfffffff0 = 0x00000020
  return timestamp - captured_timestamp;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...