Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arduino - Remote control (RF-TX)
To bi trebalo biti ovako:
Code:
int LED = 12;
int taster1 = 8;
int taster2 = 9;
unsigned char taster1test = 0;
unsigned char taster2test = 0;
boolean flag1 = false;

void setup() {
 pinMode(LED, OUTPUT);
 pinMode(taster1, INPUT);
 pinMode(taster2, INPUT);
 Serial.begin(9600);

 // initialize Timer1
 noInterrupts(); // disable all interrupts
 TCCR1A = 0;
 TCCR1B = 0;
 
 TCNT1 = 62535;//49536;//62437;//34286; // preload timer 65536-16MHz/256/2Hz
 TCCR1B |= (0 << CS10 ) | (0 << CS11) | (1 << CS12); //256
 TIMSK1 |= (1 << TOIE1); // enable timer overflow interrupt
 interrupts(); // enable all interrupts
}

 ISR(TIMER1_OVF_vect) // interrupt service routine that wraps a user defined function supplied by attachInterrupt
   {
      TCNT1 = 62535; // preload timer
      if(digitalRead(8) == HIGH){
       taster1test++;
        if(taster1test > 3){
         flag1 = true;
         digitalWrite(LED, HIGH);
        }
      }
      else{
       taster1test = 0;
      }
   }

void loop() {
 while(1){
   if(flag1){
     flag1 = false;
     Serial.println(1111);
   }
 }
}
samo nešto sam promašio, jer mi odmah zakuca u while petlju i svijetli mi ledica što sam ja dodao da znam kad je taster aktivan ali ne šalje podatke (ne svijetli mi TX lampica)?
Reply


Messages In This Thread
Arduino - Remote control (RF-TX) - by Makso - 09-10-2016, 01:02 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-10-2016, 04:03 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-10-2016, 06:20 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 05:43 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 06:40 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 07:00 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 07:07 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 07:28 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 07:33 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 07:46 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-11-2016, 08:09 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-26-2016, 03:11 PM
RE: Arduino - Remote control (RF-TX) - by Omegakg - 09-26-2016, 04:52 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-26-2016, 06:31 PM
RE: Arduino - Remote control (RF-TX) - by Omegakg - 09-26-2016, 06:57 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-26-2016, 07:14 PM
RE: Arduino - Remote control (RF-TX) - by Omegakg - 09-26-2016, 08:54 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-26-2016, 10:01 PM
RE: Arduino - Remote control (RF-TX) - by Omegakg - 09-27-2016, 10:38 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-27-2016, 12:40 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 09-27-2016, 03:40 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 09-27-2016, 04:37 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-27-2016, 05:32 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 09-27-2016, 07:58 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-27-2016, 08:07 PM
RE: Arduino - Remote control (RF-TX) - by npejcic - 09-27-2016, 09:09 PM
RE: Arduino - Remote control (RF-TX) - by Omegakg - 09-27-2016, 10:33 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-27-2016, 10:44 PM
RE: Arduino - Remote control (RF-TX) - by npejcic - 09-28-2016, 08:48 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-28-2016, 11:45 AM
RE: Arduino - Remote control (RF-TX) - by npejcic - 09-28-2016, 06:33 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-28-2016, 06:48 PM
RE: Arduino - Remote control (RF-TX) - by npejcic - 09-28-2016, 07:11 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-28-2016, 07:19 PM
RE: Arduino - Remote control (RF-TX) - by npejcic - 09-29-2016, 09:32 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 10-03-2016, 10:46 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 10-06-2016, 09:32 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 10-06-2016, 10:20 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 10-20-2016, 10:59 AM
RE: Arduino - Remote control (RF-TX) - by npejcic - 10-20-2016, 04:10 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 10-20-2016, 06:17 PM
RE: Arduino - Remote control (RF-TX) - by npejcic - 10-20-2016, 08:16 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-18-2017, 03:28 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-18-2017, 07:28 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-18-2017, 08:04 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-19-2017, 01:20 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-18-2017, 09:29 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-18-2017, 11:24 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-19-2017, 09:25 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-19-2017, 12:08 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-19-2017, 07:31 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-27-2017, 04:31 PM
RE: Arduino - Remote control (RF-TX) - by vsavic - 02-27-2017, 04:43 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-27-2017, 04:56 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 02-27-2017, 07:34 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-27-2017, 10:56 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 02-28-2017, 01:59 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-28-2017, 09:17 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 03-26-2017, 11:41 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 09-15-2017, 11:16 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 12-28-2017, 10:37 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 12-29-2017, 12:29 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 12-29-2017, 01:05 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-03-2018, 12:40 AM
RE: Arduino - Remote control (RF-TX) - by mikikg - 01-03-2018, 08:28 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-05-2018, 05:49 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-05-2018, 11:38 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-06-2018, 12:06 AM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-06-2018, 12:12 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-06-2018, 12:33 AM
RE: Arduino - Remote control (RF-TX) - by gorankg - 01-06-2018, 08:45 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-06-2018, 08:34 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-17-2018, 08:28 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-18-2018, 06:05 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-19-2018, 06:38 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-19-2018, 11:19 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-21-2018, 03:28 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-21-2018, 01:26 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-21-2018, 05:28 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 01:12 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 01:40 AM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-22-2018, 01:54 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 02:03 AM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-22-2018, 10:33 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 01:51 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-22-2018, 03:19 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-22-2018, 03:50 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 01-22-2018, 04:00 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 09:12 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-22-2018, 10:48 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-22-2018, 11:12 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-23-2018, 01:22 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-23-2018, 01:20 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-23-2018, 03:18 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-23-2018, 07:20 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 01-23-2018, 07:26 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-23-2018, 03:53 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-23-2018, 10:21 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-23-2018, 11:47 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-24-2018, 04:12 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-24-2018, 04:46 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-24-2018, 05:20 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-24-2018, 05:52 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 01-24-2018, 06:30 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-24-2018, 09:37 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-25-2018, 02:01 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-25-2018, 01:54 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-25-2018, 02:35 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-26-2018, 12:34 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-26-2018, 12:57 PM
RE: Arduino - Remote control (RF-TX) - by me[R]a - 01-26-2018, 04:05 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-26-2018, 09:08 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-31-2018, 09:02 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-31-2018, 09:39 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 01-31-2018, 10:14 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-02-2018, 06:27 PM
RE: Arduino - Remote control (RF-TX) - by gorankg - 02-02-2018, 09:35 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-02-2018, 11:33 PM
RE: Arduino - Remote control (RF-TX) - by mikikg - 02-03-2018, 10:14 AM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-03-2018, 02:13 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 02-03-2018, 08:59 PM
RE: Arduino - Remote control (RF-TX) - by Makso - 05-26-2018, 12:03 PM

Forum Jump:


Users browsing this thread: 18 Guest(s)