Hello,i have the version 1.6.12 of arduino and 1.31 of teensyduino.
I have written this code
when i do compile i have this error
Arduino: 1.6.12 (Windows 7), TD: 1.31, Πλακέτα:"Teensy 3.6, Serial, 180 MHz, US English"
receiver_tennsy: In function 'void setup()':
receiver_tennsy:19: error: 'transmitter_signals' was not declared in this scope
receiver_tennsy: In function 'void loop()':
'transmitter_signals' was not declared in this scope
What is the problem?
I have written this code
Code:
volatile byte channel_1, channel_2, channel_3, channel_4, channel_5, channel_6;
volatile int transmitter_channel_1, transmitter_channel_2, transmitter_channel_3, transmitter_channel_4, transmitter_channel_5, transmitter_channel_6;
volatile unsigned long current_time, time_channel_1, time_channel_2, time_channel_3, time_channel_4, time_channel_5, time_channel_6;
void setup() {
pinMode(2, INPUT);
pinMode(6, INPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);
pinMode(14, INPUT);
pinMode(20, INPUT);
while(!Serial);
Serial.begin(9600);
attachInterrupt(digitalPinToInterrupt(2), transmitter_signals, CHANGE);
attachInterrupt(digitalPinToInterrupt(6), transmitter_signals, CHANGE);
attachInterrupt(digitalPinToInterrupt(7), transmitter_signals, CHANGE);
attachInterrupt(digitalPinToInterrupt(8), transmitter_signals, CHANGE);
attachInterrupt(digitalPinToInterrupt(14), transmitter_signals, CHANGE);
attachInterrupt(digitalPinToInterrupt(20), transmitter_signals, CHANGE);
}
void loop() {
Serial.println(transmitter_channel_1);
Serial.println(transmitter_channel_2);
Serial.println(transmitter_channel_3);
Serial.println(transmitter_channel_4);
Serial.println(transmitter_channel_5);
Serial.println(transmitter_channel_6);
delay(100);
}
void transmitter_signals(){
current_time = micros();
if(channel_1 == 0 && GPIOD_PDIR & (1<<0)){
channel_1 = 1;
time_channel_1 = current_time;
}
else if(channel_1 == 1){
channel_1 = 0;
transmitter_channel_1 = current_time - time_channel_1;
}
if(channel_2 == 0 && GPIOD_PDIR & (1<<1)){
channel_2 = 1;
time_channel_2 = current_time;
}
else if(channel_2 == 1){
channel_2 = 0;
transmitter_channel_2 = current_time - time_channel_2;
}
if(channel_3 == 0 && GPIOD_PDIR & (1<<2)){
channel_3 = 1;
time_channel_3 = current_time;
}
else if(channel_3 == 1){
channel_3 = 0;
transmitter_channel_3 = current_time - time_channel_3;
}
if(channel_4 == 0 && GPIOD_PDIR & (1<<3)){
channel_4 = 1;
time_channel_4 = current_time;
}
else if(channel_4 == 1){
channel_4 = 0;
transmitter_channel_4 = current_time - time_channel_4;
}
if(channel_5 == 0 && GPIOD_PDIR & (1<<4)){
channel_5 = 1;
time_channel_5 = current_time;
}
else if(channel_5 == 1){
channel_5 = 0;
transmitter_channel_5 = current_time - time_channel_5;
}
if(channel_6 == 0 && GPIOD_PDIR & (1<<5)){
channel_6 = 1;
time_channel_6 = current_time;
}
else if(channel_6 == 1){
channel_6 = 0;
transmitter_channel_6 = current_time - time_channel_6;
}
}
when i do compile i have this error
Arduino: 1.6.12 (Windows 7), TD: 1.31, Πλακέτα:"Teensy 3.6, Serial, 180 MHz, US English"
receiver_tennsy: In function 'void setup()':
receiver_tennsy:19: error: 'transmitter_signals' was not declared in this scope
receiver_tennsy: In function 'void loop()':
'transmitter_signals' was not declared in this scope
What is the problem?
Last edited: