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
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() {
}