Dependencies:   mbed

Committer:
BenRJG
Date:
Wed Apr 18 08:50:25 2018 +0000
Revision:
6:a61b01442f37
Parent:
5:11489c0bd020
Child:
8:462ce856429b
Fixed multiple defined Reset and Undefined func

Who changed what in which revision?

UserRevisionLine numberNew contents of line
BenRJG 5:11489c0bd020 1 #include "FPGA.h"
BenRJG 5:11489c0bd020 2 #include "LCD.h"
BenRJG 5:11489c0bd020 3 #include "ADC.h"
BenRJG 5:11489c0bd020 4 float adval;
BenRJG 5:11489c0bd020 5 char adstr[32];
BenRJG 5:11489c0bd020 6 int err; //error variable used for debugging, trapping etc
BenRJG 0:87903e5535bc 7
BenRJG 0:87903e5535bc 8 int main (void)
BenRJG 2:b615682e3e4f 9 {
BenRJG 6:a61b01442f37 10 reset_board();
BenRJG 6:a61b01442f37 11
BenRJG 2:b615682e3e4f 12 SPI_INIT();
BenRJG 5:11489c0bd020 13 /*err = 0;
BenRJG 5:11489c0bd020 14
BenRJG 5:11489c0bd020 15 adval =0.0f;
BenRJG 5:11489c0bd020 16
BenRJG 5:11489c0bd020 17 adval = read_adc();
BenRJG 5:11489c0bd020 18
BenRJG 5:11489c0bd020 19 sprintf(adstr,"%.3f",adval); //Store in an array string
BenRJG 5:11489c0bd020 20 lcd_locate(1,8); //and display on LCD
BenRJG 5:11489c0bd020 21 lcd_display(adstr); //
BenRJG 5:11489c0bd020 22
BenRJG 5:11489c0bd020 23 err = bar_graph(((adval/3.3f)*4095)/255); // 16*256 =4096 12 bit ADC!
BenRJG 5:11489c0bd020 24
BenRJG 5:11489c0bd020 25 if (err < 0){printf("Display Overload\r\n");}*/
BenRJG 5:11489c0bd020 26
BenRJG 1:acc66d3a1a1c 27 while(true) //Loop forever Knight Rider Display on FPGA
BenRJG 0:87903e5535bc 28 {
BenRJG 2:b615682e3e4f 29 SPI_TEST();
BenRJG 0:87903e5535bc 30 }
BenRJG 0:87903e5535bc 31 }