using System;
using System.Threading;
using System.IO.Ports;
using System.Text;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHI.Hardware.EMX;

// Slot 14 on FEZ Spider        SPider     ADC
// Pin  1 -- VCC
// Pin  2 -- +5V
// Pin  3 -- IO69/LCD_R0        SCLK --->
// Pin  4 -- IO65/LCD_R1        MOSI --->
// Pin  5 -- IO66/LCD_R2        MOSI <---           
// Pin  6 -- IO67/LCD_R3        CS   ---> 
// Pin  7 -- IO68/LCD_R4
// Pin  8 -- IO62/LCD_VSYNC
// Pin  9 -- IO64/LCD_HSYNC
// Pin 10 -- GND


namespace CPF
{
    public class Program
    {
        private static OutputPort _SPI_clock;
        private static OutputPort _SPI_mosi;
        private static InputPort  _SPI_miso;

        // Starts listening to the Pressure Sensor
        public static void Main()
        {
            _SPI_clock = new OutputPort(Pin.IO69, false);
            _SPI_mosi = new OutputPort(Pin.IO65, false);
            _SPI_miso = new InputPort(Pin.IO66, false, Port.ResistorMode.PullDown);

            while (true)
            {
                _SPI_clock.Write(!_SPI_clock.Read());
            }
        }

   }
}
