X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;ds=sidebyside;f=dart%2Fdart.pde;h=52a20631894f06e8cc7fa0e408bd09e555ca9d25;hb=c71c4e8571f57c36c233bf41b850478c21bb9518;hp=7fbefaf9c5b28f133a80ffabe1cc1091988e68ae;hpb=d9a06db53e7eb1511cf3f9f0703987ac28e11781;p=svn42.git diff --git a/dart/dart.pde b/dart/dart.pde index 7fbefaf..52a2063 100644 --- a/dart/dart.pde +++ b/dart/dart.pde @@ -24,25 +24,22 @@ union union16 { uint16_t uint16; }; +uint8_t zahlen[] = {115,110,46,78,51,83,82,68,99,105,41,73,35,67,50,36,113,108,44,76,49,81,114,100,98,101,37,69,34,66,102,109,111,116,52,84,47,79,57,89,106,97,33,65,42,74,38,45,112,104,40,72,48,80,0,0,103,107,43,75,39,71,70,77} ; + union union32 { byte uint8[4]; uint16_t uint16[2]; uint32_t uint32; }; - -//********************************************************************// - typedef unsigned char byte; -//********************************************************************// -/* void start_timer() { // timer 1: 2 ms TCCR1A = 0; // prescaler 1:8, WGM = 4 (CTC) - TCCR1B = 1< 0.08ms @ 16 MHz -> 1*alpha + TCCR1B = 1< 0.08ms @ 16 MHz -> 1*alpha // OCR1A = 207; // (1+207)*8 = 1664 -> 0.104ms @ 16 MHz -> 1*alpha TCNT1 = 0; // reseting timer TIMSK1 = 1<>=1) + value++; + value<<=3; + while(output>>=1) + value++; + //Serial.println(value,HEX); + byte zahl = zahlen[value]; + + byte multi = zahl >> 5; + byte base = zahl & B11111; + Serial.print(0+multi); + Serial.print("\t"); + Serial.println(0+base); + PCICR&= ~ B111; // Disable Interrupt + start_timer(); } SIGNAL(PCINT0_vect) { - PCint(0); + PCint(); } SIGNAL(PCINT1_vect) { - PCint(1); + PCint(); } SIGNAL(PCINT2_vect) { - PCint(2); + PCint(); } void setup() { @@ -103,7 +129,6 @@ void setup() PCMSK1=PINC_MASK & INPUT_SIG_PORTC; PCMSK2=PIND_MASK & INPUT_SIG_PORTD; PCICR|= B111; - // start_timer(); } @@ -115,6 +140,4 @@ void loop() { // Serial.Serial.println("foo"); // return; - - }