Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
app board RGB
main.py
# app-board-RGB mbed NXP LPC1768 # http://mbed.org/users/chris/code/app-board-RGB/ import mbed import sys r = mbed.PwmOut('p23') g = mbed.PwmOut('p24') b = mbed.PwmOut('p25') r.period(0.001); while 1: i = 0.0 while i < 1.0: p = 3.0 * i r.write(1.0 - (1.0 - p if p < 1.0 else (p - 2.0 if p > 2.0 else 0.0))) g.write(1.0 - (p if p < 1.0 else (0.0 if p > 2.0 else 2.0 - p))) b.write(1.0 - (0.0 if p < 1.0 else (3.0 - p if p > 2.0 else p - 1.0))) sys.wait(10) # 10ms i += 0.001