From e7e1634240c78c7abbdc7fc6e0af1beddaea1d45 Mon Sep 17 00:00:00 2001 From: neoraider Date: Tue, 17 Apr 2007 22:10:05 +0000 Subject: Linienverfolgung implementiert --- Tcs230.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Tcs230.cpp (limited to 'Tcs230.cpp') 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); +} -- cgit v1.2.3