problem using digitalreadfast

Status
Not open for further replies.

gony

Well-known member
hi all
i'm using digitalreadfast () but keep getting the error message :
fatal error: digitalWriteFast.h: No such file or directory

is this file not part of the general software i downloaded? if so where can i download it and how do i add it ?

this is the general code for your inspection
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
#include <digitalWriteFast.h>

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};

unsigned long sensorVal = 0;


IntervalTimer myTimerOne;
IntervalTimer myTimerTwo;

void reward(void) {
  sensorVal = (GPIOA_PDIR >> 12) & 0xF; // Register A, ready signal and XS2
  if (!(sensorVal & 1) && ((GPIOB_PDIR & 0xF) == 4) && (sensorVal & 2)) { // Received command
    digitalWriteFast(34, HIGH)// reward
    delayMicroseconds(GPIOC_PDIR); //delay time is the reward giving time
    digitalWriteFast(34, LOW); //stop giving reward
  }
}

void markerSt(void) {
  if (!(sensorVal & 1) && ((GPIOB_PDIR & 0xF) == 1)) {
    GPIOD_PDOR = (GPIOC_PDIR >> 1) & 0xFF;
    delayMicroseconds(onDur);
    GPIOD_PDOR = 0x00;
  }
}

void setup() {
 
  for (int pinnum = 0; pinnum < 14; pinnum++) {
    //    pinMode(inputPins[pinnum], INPUT_PULLUP);
    pinMode(inputPins[pinnum], INPUT);
  }
  for (int pinnum = 0; pinnum < 8; pinnum++) {
    pinMode(outputPIns[pinnum], OUTPUT);
  }
  myTimerOne.priority(0);
  myTimerOne.begin(trialSt, 1);
  myTimerOne.priority(0);
  myTimerTwo.priority(1);
  myTimerTwo.begin(markerSt, 1);
  myTimerTwo.priority(1);
}

void loop() {
  
}
 
You shouldn't need to include anything for digitalReadFast() and digitalWriteFast() to work. First thing to try: simply remove the line
Code:
[COLOR=#333333]#include <digitalWriteFast.h>
[/COLOR]

Have you installed teensiduino? What version? What Arduino version? What operating system and OS version? What happens when you try the example programs like Blink?
 
yes , i have installed teensyduino 1.39 , arduino 1.8.4 . windows 10 pro education , version 1703 , system type 64-bit os .
so far , all of my mini projects worked fine . i used digitalread/write , made some buttons blink some leds etc

i think the problem was with the include line . to begin with , i wrote that line because there was a problem but i think now its gone . will update if something goes wrong.
 
Status
Not open for further replies.
Back
Top