# How to use C-Script to generate a triangular wave with adjustable amplitude and frequency, and use the triangular wave as a carrier for modulation

**URL:** <https://forum.plexim.com/t/how-to-use-c-script-to-generate-a-triangular-wave-with-adjustable-amplitude-and-frequency-and-use-the-triangular-wave-as-a-carrier-for-modulation/2405>\
**Category:** PLECS\
**Tags:** plecs, c-script\
**Created:** [August 1, 2025, 3:19pm UTC](https://forum.plexim.com/t/how-to-use-c-script-to-generate-a-triangular-wave-with-adjustable-amplitude-and-frequency-and-use-the-triangular-wave-as-a-carrier-for-modulation/2405 "2025-08-01T15:19:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Munadir\_Ahmed](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/munadir_ahmed/32/1540_2.png) [@Munadir\_Ahmed](https://forum.plexim.com/u/Munadir_Ahmed)\
**Post date:** [August 1, 2025, 7:10pm UTC](https://forum.plexim.com/t/how-to-use-c-script-to-generate-a-triangular-wave-with-adjustable-amplitude-and-frequency-and-use-the-triangular-wave-as-a-carrier-for-modulation/2405/2 "2025-08-01T19:10:10Z")

</div>

Hello, could you specify what you are trying to model? While the C-Script is very powerful I would be cautious in using it as it can cause you a lot of headache.

If you are simply looking for a variable frequency triangular waveform generator have a look at this ticket: [Triangular wave with variable frequency - #2 by Bryan\_Lieblick](https://forum.plexim.com/t/triangular-wave-with-variable-frequency/1152/2) .

---

_[View the full topic](https://forum.plexim.com/t/how-to-use-c-script-to-generate-a-triangular-wave-with-adjustable-amplitude-and-frequency-and-use-the-triangular-wave-as-a-carrier-for-modulation/2405)._
