James Devine / Mbed 2 deprecated cosmicpi1point7_alpha

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 //------------------------------------
00004 // Hyperterminal configuration
00005 // 9600 bauds, 8-bit data, no parity
00006 //------------------------------------
00007 
00008 //Serial pc(SERIAL_TX, SERIAL_RX);
00009 Serial pc2(PA_9, PA_10);
00010 Serial gps(PA_2, PA_3);
00011 
00012 //i2c bus for peripherals
00013 I2C i2c(PB_7 , PB_8 ); 
00014 
00015 //indicator LEDs
00016 DigitalOut evt_led(PA_8);
00017 DigitalOut pwr_led(PA_7);
00018 
00019 //raspberry pi flag 
00020 DigitalOut rpi_flag(PB_1);
00021 
00022 //hv psu outputs and inputs
00023 DigitalOut hvpsu_din(PC_3);
00024 DigitalOut hvpsu_sclk(PC_13);
00025 DigitalOut hvpsu_cs2(PC_7);
00026 DigitalOut hvpsu_cs1(PC_8);
00027 DigitalIn hvpsu_cl1(PC_1);
00028 DigitalIn hvpsu_cl2(PC_2);
00029 
00030 //cosmic ray detection inputs
00031 DigitalIn strigout_b(PC_11);
00032 DigitalIn strigout_a(PC_12);
00033 InterruptIn trig_out(PB_3);
00034 
00035 //GPS timing input
00036 InterruptIn gps_pps(PA_15);
00037 
00038 //analogue inputs
00039 AnalogIn shaped_out1(PA_0);
00040 AnalogIn shaped_out2(PA_1);
00041 AnalogIn bias_fb1(PA_4);
00042 AnalogIn bias_fb2(PA_5);
00043 
00044 
00045 
00046 int main()
00047 {
00048     int i = 1;
00049     //pc.printf("Hello World !\n");
00050     pc2.printf("Hello World !\n");
00051     //myledb=1;
00052     while(1) {
00053         wait(1);
00054       //  pc.printf("This program runs since %d seconds.\n", i++);
00055         pc2.printf("UART1 runs since %d seconds.\n", i++);
00056         //myled = !myled;
00057         //myledb = !myledb;
00058         
00059     }
00060 }