//JApins54.h
// Bambino
// TAB FILE > pins20.h
//****************************************************************************
#ifdef Jet
//****************************************************************************
//== PINS ===================================================
/*
Sensor Shield V5+
-----------------
D0 - D13 V+ is supplied from Screw Connector on V5-Shield
if SEL jumper is ON then Arduino V+ connects to Shield V+

pins 0 (RX) and 1 (TX
Input and Output. 
External Interrupts: pins 2 and 3. 
  These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. 
  PWM: 3, 5, 6, 9, 10, and 11. 
  SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). 
  LED: 13. 
  TWI: A4 or SDA pin and A5 or SCL pin. 
  AREF. 
  Reset.
*/
// Shield V5 tripins 0 to 3 are modified to use Arduino V-logic
//pin0 Rx                    0
//pin1 Tx                    1
//pin2 SoftSerial Rx         2 - needs Arduino V-logic to power PicAxe08m2
const byte pingPin          =3; //PWM   - HC-SR04 trigger and receive pin, 2k2 between Trig and Echo     
// Shield V5 tripins 4 to 13 are V-battery
// pin4  SoftSerial Tx       4   but not used
// pin5                      5   PWM
const byte servoRollPin     =6;     //PWM - Roll servo
const byte servoPacePin     =7;     //D   - Pace servo
const byte RtoeWLEDpin      =8;     //D   - Right toeLED,     HIGH=on
const byte RwhiskerLEDpin   =9;     //PWM - Right whiskerLED, HIGH=on
const byte LwhiskerLEDpin   =10;    //PWM - Left whiskerLED,  HIGH=on
const byte LtoeWLEDpin      =11;    //PWM - Left toeLED,      HIGH=on
// pin12
const byte headLEDpin       =13;    //D   - red LED, HIGH=on  red/yellow/green, 100R, if walking blinks when ready
const byte voicePin         =13;    //D   - Speaker piezo
//const byte LEDpin           =13;    //D   - board LED

// Shield V5 tripins A0 - A5 V+ is supplied from Arduino V-logic
const byte RtoeWSensePin    =A0;    //A   - Left Beard photo-transistor
const byte RwhiskerSensePin =A1;    //A   - Left whisker photo-transistor
const byte LwhiskerSensePin =A2;    //A   - Right whisker photo-transistor
const byte LtoeWSensePin    =A3;    //A   - Right Beard photo-transistor
const byte RgroundPin       =A4;    //A   - Right Ground sense
const byte LgroundPin       =A5;    //A   - Right Ground sense 
//===========================================================
#endif
//****************************************************************************
#ifdef BambinoPM
//****************************************************************************
//== PINS ===================================================
//pin0 Rx
//pin1 Tx
//pin2 
const byte IRoutpin         =3;     //PWM - IR comms out   (Sheriff library)
const byte headLEDpin       =4;     //D   - red LED, HIGH=on
const byte voicePin         =4;     //D   - Speaker
const byte pingPin          =5;     //PWM - HC-SR04 trigger and receive pin     
const byte servoRollPin     =6;     //PWM - Roll servo
const byte servoPacePin     =7;     //D   - Pace servo
const byte RbeardLEDpin_    =8;     //D   - Right BeardLED, LOW=on
const byte LbeardLEDpin_    =9;     //PWM - Left BeardLED, LOW=on
const byte LwhiskerLEDpin_  =10;    //PWM - Left whiskerLED, LOW=on
const byte RwhiskerLEDpin_  =11;    //PWM - Right whiskerLED, LOW=on
const byte IRinpin_         =12;    //D   - IR comms in
const byte LEDpin           =13;    //D   - board LED
const byte LwhiskerSensePin =A0;    //A   - Left whisker photo-transistor
const byte LbeardSensePin   =A1;    //A   - Left Beard photo-transistor
const byte RbeardSensePin   =A2;    //A   - Right Beard photo-transistor
const byte RwhiskerSensePin =A3;    //A   - Right whisker photo-transistor
//A4 - on non standard centres
//A5 - on non standard centres
//A6 - on non standard centres
//A7 - on non standard centres
//===========================================================
#endif
//****************************************************************************
#ifdef BambinoM2
//****************************************************************************
//M2 pcb RevC
//== PINS ===================================================
//pwm Analog write Arduino boards with the ATmega328), works on pins 3, 5, 6, 9, 10, and 11

//pin0 Tx
//pin1 Rx
const byte RbeardLEDpin_    =2;    //D   - Right BeardLED, LOW=on   PWM
const byte servoPacePin     =3;    //PWM - Pace servo
//4     //D   -
const byte IRoutpin         =5;   //PWM  - NOT FITTED, IR comms out - can't use IR library with this should be 3
const byte pingPin          =6;    //PWM - HC-SR04 trigger and receive pin     
const byte voicePin         =7;    //D   - Speaker & LED
//const byte voiceLEDpin      =7;    //D   -
const byte IRinpin_         =8;    //D   - NOT FITTED, IR comms
const byte RwhiskerLEDpin_  =9;    //PWM - Right whiskerLED, LOW=on
const byte servoRollPin     =10;   //PWM - Roll servo
const byte LwhiskerLEDpin_  =11;   //PWM - Left whiskerLED, LOW=on
const byte LbeardLEDpin_    =12;   //D   - Left BeardLED, LOW=on
const byte headLEDpin       =13;   //D   - red LED, HIGH=on
const byte LwhiskerSensePin =A3;   //A   - Left whisker photo-transistor
const byte LbeardSensePin   =A2;   //A   - Left Beard photo-transistor
const byte RbeardSensePin   =A1;   //A   - Right Beard photo-transistor
const byte RwhiskerSensePin =A0;   //A   - Right whisker photo-transistor
const byte IIC_SCL          =A5; 
const byte IIC_SDA          =A4;
//===========================================================
#endif
//****************************************************************************
#ifdef BambinoMM
//****************************************************************************
//== PINS ===================================================
//pin0 Tx
//pin1 Rx
const byte IRinpin_       =2;     //D   - 
const byte headLEDpin_    =3;     //PWM - LOW=on
//4     //D   - 
const byte pingPin        =5;     //PWM - HC-SR04 trigger and receive pin    
//6     //PWM - 
//7     //D   - 
const byte RbeardLEDpin_  =8;     //D   - Right beardLED on pin 8, LOW=on
const byte voicePin       =9;     //PWM - Speaker on pin 9
const byte servoRollPin   =10;    //PWM - Roll servo on pin 10   
//11     //PWM - 
//12     //D   - 
//13     //D   - 
//A0     //A   - 
const byte RbeardSensePin =A1;    //A   - photo-transistor
const byte LbeardSensePin =A2;    //A   - photo-transistor
const byte servoPacePin   =A3;    //A   - Pace servo
const byte LbeardLEDpin_  =A5;    //A   - LOW=on
//Dummies - whisker not fitted on BambinoMM
const byte RwhiskerLEDpin_  =8;    //A - LOW=on
const byte RwhiskerSensePin =A1;   //A - photo-transistor
const byte LwhiskerLEDpin_  =A5;   //A - LOW=on
const byte LwhiskerSensePin =A2;   //A - transistor      
//===========================================================
#endif
