This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-rescue/Tcs230.cpp
2007-04-17 22:10:05 +00:00

28 lines
458 B
C++

#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);
}