summaryrefslogtreecommitdiffstats
path: root/Tcs230.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-04-18 00:10:05 +0200
committerneoraider <devnull@localhost>2007-04-18 00:10:05 +0200
commite7e1634240c78c7abbdc7fc6e0af1beddaea1d45 (patch)
treee09406ef8e02fbd7923734acb2e36d5e93d8f6db /Tcs230.cpp
parentd02fbc84105ff2da74f03fd658ace8919e3e9437 (diff)
downloadrc2007-rescue-e7e1634240c78c7abbdc7fc6e0af1beddaea1d45.tar
rc2007-rescue-e7e1634240c78c7abbdc7fc6e0af1beddaea1d45.zip
Linienverfolgung implementiert
Diffstat (limited to 'Tcs230.cpp')
-rw-r--r--Tcs230.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Tcs230.cpp b/Tcs230.cpp
new file mode 100644
index 0000000..796bcb3
--- /dev/null
+++ b/Tcs230.cpp
@@ -0,0 +1,28 @@
+#include "Tcs230.h"
+#include "avr.h"
+
+
+Tcs230::Tcs230()
+{
+ enabled = false;
+ color = Red;
+ scaling = Off;
+}
+
+void Tcs230::setEnabled(bool enabled) {
+ this->enabled = enabled;
+
+ PORTC = (PORTC&~0x40)|(enabled?0x40:0);
+}
+
+void Tcs230::setColor(Tcs230Colors color) {
+ this->color = color;
+
+ PORTC = (PORTC&~0x0C)|((color<<2)&0x0C);
+}
+
+void Tcs230::setScaling(Tcs230Scalings scaling) {
+ this->scaling = scaling;
+
+ PORTC = (PORTC&~0x30)|((scaling<<4)&0x30);
+}