hi all
i'm working on a project with teensy 3.6 , code is not good i think , cause i'm not getting any output.
maybe someone can track a simple problem with the code?
anyway , i want to understand what goes wrong and for that i want to print certain things ( for checking ) so i write Serial.begin(9600) in the setup and then the print command but nothing shows in the monitor . i tried all three COM ports none did the job. i plugged everything out and tried to write simple code
also nothing shows up on the monitor for all ports . made sure the usb type is set to serial. made sure baud rate is 9600 in serial begin and in the monitor . my software is up to date and also the monitor did work in the past when i worked on some tutorials.
what can be the cause ?
one more thing ,
is there a better way to debug ? i mean like when i use matlab i have an option to use breakpoints or even step by step progression to see where the error is happening?
thanks a million!
i'm working on a project with teensy 3.6 , code is not good i think , cause i'm not getting any output.
Code:
// PTA (12 13) = [3 4] // ready signal and XS2
// PTB (0 1 2 3) = [16 17 19 18] // For address bits
// PTC (0 1 2 3 4 5 6 7 8 9 10 11) = [15 22 23 9 10 13 11 12 35 36 37 38] // For digital inputs from NI cards
// PTD (0 1 2 3 4 5 6 7 ) = [2 14 7 8 6 20 21 5] // For digital output to marker
// PTE (25) = [34] // for digital output to reward
byte inputPins[] = {3, 4, 16, 17, 19, 18, 15, 22, 23, 9, 10, 13, 11, 12, 35, 36, 37, 38};
byte outputPIns[] = {2, 14, 7, 8, 6, 20, 21, 5, 34};
IntervalTimer myTimerOne;
void reward(void) {
if (!digitalReadFast(3) && ((GPIOB_PDIR & 0xF) == 4)){// Received command
digitalWriteFast(34, HIGH);//reward
delayMicroseconds(GPIOC_PDIR); //delay time is the reward giving time
digitalWriteFast(34, LOW); //stop giving reward
}
}
void setup() {
pinMode(34,OUTPUT);
for (int pinnum = 0; pinnum < 18; pinnum++) {
// pinMode(inputPins[pinnum], INPUT_PULLUP);
pinMode(inputPins[pinnum], INPUT);
}
for (int pinnum = 0; pinnum < 9; pinnum++) {
pinMode(outputPIns[pinnum], OUTPUT);
}
myTimerOne.priority(0);
myTimerOne.begin(reward,1);
myTimerOne.priority(0);
}
void loop() {
}
maybe someone can track a simple problem with the code?
anyway , i want to understand what goes wrong and for that i want to print certain things ( for checking ) so i write Serial.begin(9600) in the setup and then the print command but nothing shows in the monitor . i tried all three COM ports none did the job. i plugged everything out and tried to write simple code
Code:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print("test");
}
what can be the cause ?
one more thing ,
is there a better way to debug ? i mean like when i use matlab i have an option to use breakpoints or even step by step progression to see where the error is happening?
thanks a million!