#include <AccelStepper.h> // libary for stepper motor
#include <Tone.h> // library for piezo buzzer
// Pin Mappings (#defines do text replacement)
#define NOSE_POKE_1 2 // nose_poke 1 is mapped to pin 2
#define NOSE_POKE_2 3
#define NOSE_POKE_R 4 // REWARD PORT
#define LED_1 5 // LED_1 is paired with Nose_Poke_1
#define LED_2 6
#define LED_R 7
// House Light and Piezo Buzzer pins:
#define BUZZER_PIN 9 // selected pin must be capable of PWM for this feature to work (9 is ok)
#define HOUSE_LIGHT A0 // for A0 PWM features will work on the Teensy, but not in this simulation
// Pins related to the SD card: (NOTE: different on the Teensy)
#define SD_DETECT 8 // connected to ground when no SD card is present (so use INPUT_PULLUP)
#define CHIP_SELECT_PIN 10 // AKA: SS
#define MOSI_PIN 11
#define MISO_PIN 12
#define SPI_CLOCK_PIN 13 // AKA: SCK
// Pins related to the stepper motor:
#define STEP_PIN A1
#define DIRECTION_PIN A2
#define ENABLE_PIN A3
#define USER_BUTTON A4
//#define PELLET_DETECTOR A5 // hardware not yet implmented
// Data arrays will go up here
//Start of actual code to run FR1 schedule
void setup() {
// put your setup code here, to run once:
pinMode(LED_1, OUTPUT); //pinmode specifies how a pin is used
pinMode(LED_2, OUTPUT);
pinMode(LED_R, OUTPUT);
digitalWrite(LED_1, HIGH); // turns led on in HIGH, off in LOW
digitalWrite(LED_2, HIGH);
digitalWrite(LED_R, HIGH);
pinMode (BUZZER_PIN, OUTPUT);
digitalWrite(BUZZER_PIN, LOW);
pinMode(NOSE_POKE_1, INPUT_PULLUP); // INPUT_PULLUP gives a default of high, nose poke will make the voltage go to ground
pinMode(NOSE_POKE_2, INPUT_PULLUP);
pinMode(NOSE_POKE_R, INPUT_PULLUP);
pinMode(USER_BUTTON, INPUT_PULLUP);
//don't need digitalWrite for inputs, only outputs
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_1, LOW);
delay(500);
digitalWrite(LED_1, HIGH);
delay(500);
}