adc geht
This commit is contained in:
parent
472d0135df
commit
f55fd367ee
7 changed files with 71 additions and 22 deletions
13
main.cpp
13
main.cpp
|
@ -4,6 +4,7 @@
|
|||
#include <avr/wdt.h>
|
||||
#include "mcp23s17.h"
|
||||
#include "tlc5615.h"
|
||||
#include "adu.h"
|
||||
|
||||
#define LED B0
|
||||
|
||||
|
@ -12,6 +13,7 @@ SPI spi;
|
|||
MCP23S17 beba0(spi, SPIADR::BEBA0);
|
||||
MCP23S17 sw(spi, SPIADR::SWITCH);
|
||||
TLC5615 dac0(spi, SPIADR::AA0);
|
||||
ADU adu;
|
||||
|
||||
ISR(WDT_vect)
|
||||
{
|
||||
|
@ -27,7 +29,7 @@ ISR(WDT_vect)
|
|||
|
||||
int main()
|
||||
{
|
||||
//WDTCSR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0);
|
||||
WDTCSR = _BV(WDIE) | _BV(WDP3) | _BV(WDP0);
|
||||
dMode(LED, OUT);
|
||||
dWrite(LED, LOW);
|
||||
wdt_reset();
|
||||
|
@ -38,14 +40,13 @@ int main()
|
|||
beba0.setDirA(0x00); // alle Ausgang
|
||||
beba0.setDirB(0xFF); // alle Eingang
|
||||
sw.setDirB(0xFF); // alle Eingang
|
||||
|
||||
adu.init();
|
||||
|
||||
while(1)
|
||||
{
|
||||
for(uint16_t i = 0; i < 1024; i++)
|
||||
{
|
||||
dac0.setValue(i);
|
||||
_delay_us(10);
|
||||
}
|
||||
dac0.setValue(adu.getValue(6));
|
||||
wdt_reset();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue