This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pulsweitenmodulation

Hallo,
ich muss eine Pulsweitenmodulation programmieren, für ein Schulprojekt.
Es funktioniert aber nicht so ganz wie ich mir das vorstelle.

Ein paar Details:

1) Vielleicht kennt ja wer das Humerboard.
2) Ich hab einen LPC935/LPC936 drauf.
3) Ich will eine RGB-LED ansteuern, was auch zum teil funktioniert.

Mein Problem:

1) Wie vorher schon gesagt, möchte ich gerne eine PWM programmieren wo ich eine RGB-LED ansteuere. Ich schaff es, dass sie leuchtet. ABER jetzt will ich zusätzlich noch mit einem Taster (der sich am Board befindet Port: P1^4) die Farben bestimmen können. Also wenn z.B. die Farbe grün da ist, das die solange heller und dunkler wird bis ich den Taster drücke und dann z.B. die Farbe blau kommt usw.

Vielleicht hat von euch wer eine Idee mit der er mir helfen könnte.

mfg. Pauli

Parents
  • 2) Ich hab einen LPC935/LPC936 drauf.
    3) Ich will eine RGB-LED ansteuern, was auch zum teil funktioniert.

    a simple way (describing 4 bit resolution - expand as you want)
    unblank as selected, time 0.5ms, unblank as selected, time 1ms, unblank as selected, time 2ms, unblank as selected, time 4ms, repeat

    example, creating yellow:
    unblank G, time 0.5ms, unblank G, time 1ms, unblank G, time 2ms, unblank R, time 4ms, repeat

    example, creating amber:
    unblank G, time 0.5ms, unblank R & G, time 1ms, unblank G, time 2ms, unblank R, time 4ms, repeat

    Erik

Reply
  • 2) Ich hab einen LPC935/LPC936 drauf.
    3) Ich will eine RGB-LED ansteuern, was auch zum teil funktioniert.

    a simple way (describing 4 bit resolution - expand as you want)
    unblank as selected, time 0.5ms, unblank as selected, time 1ms, unblank as selected, time 2ms, unblank as selected, time 4ms, repeat

    example, creating yellow:
    unblank G, time 0.5ms, unblank G, time 1ms, unblank G, time 2ms, unblank R, time 4ms, repeat

    example, creating amber:
    unblank G, time 0.5ms, unblank R & G, time 1ms, unblank G, time 2ms, unblank R, time 4ms, repeat

    Erik

Children
No data