Source code for the Curilights Controller. See http://www.saccade.com/writing/projects/CuriController/ for details.
Dependencies: FatFileSystem mbed
This is the source code for the Curilights controller. This lets you interactively control a string of Curilights. It provides a simple click-wheel user interface for changing colors, brightness and behavior. It responds to movement and lighting.
Finished Controller
System Block Diagram
SerialConnect.cpp@4:cfef06d8bb96, 2013-02-11 (annotated)
- Committer:
- isonno
- Date:
- Mon Feb 11 05:04:18 2013 +0000
- Revision:
- 4:cfef06d8bb96
- Parent:
- 0:6da5625a6946
Minor changes to add backlight routines. Not hooked up yet, shouldn't affect build operation.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
isonno |
0:6da5625a6946 | 1 | // SerialConnect.cpp - Connect two serial ports together |
isonno |
0:6da5625a6946 | 2 | |
isonno |
0:6da5625a6946 | 3 | #include "mbed.h" |
isonno |
0:6da5625a6946 | 4 | |
isonno |
0:6da5625a6946 | 5 | #include "SerialConnect.h" |
isonno |
0:6da5625a6946 | 6 | |
isonno |
0:6da5625a6946 | 7 | SerialConnect::SerialConnect( PinName txA, PinName rxA, |
isonno |
0:6da5625a6946 | 8 | PinName txB, PinName rxB ) |
isonno |
0:6da5625a6946 | 9 | : fPortA( txA, rxA ), fPortB( txB, rxB ) |
isonno |
0:6da5625a6946 | 10 | { |
isonno |
0:6da5625a6946 | 11 | fPortA.attach( this, &SerialConnect::HandleAtoB ); |
isonno |
0:6da5625a6946 | 12 | fPortB.attach( this, &SerialConnect::HandleBtoA ); |
isonno |
0:6da5625a6946 | 13 | } |
isonno |
0:6da5625a6946 | 14 | |
isonno |
0:6da5625a6946 | 15 | void SerialConnect::HandleAtoB() |
isonno |
0:6da5625a6946 | 16 | { |
isonno |
0:6da5625a6946 | 17 | while (fPortA.readable()) |
isonno |
0:6da5625a6946 | 18 | fPortB.putc(fPortA.getc()); |
isonno |
0:6da5625a6946 | 19 | } |
isonno |
0:6da5625a6946 | 20 | |
isonno |
0:6da5625a6946 | 21 | void SerialConnect::HandleBtoA() |
isonno |
0:6da5625a6946 | 22 | { |
isonno |
0:6da5625a6946 | 23 | while (fPortB.readable()) |
isonno |
0:6da5625a6946 | 24 | fPortA.putc( fPortB.getc() ); |
isonno |
0:6da5625a6946 | 25 | } |
isonno |
0:6da5625a6946 | 26 |