Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: N5110 ShiftReg Tone mbed
Fork of 1620_Project_Template by
Diff: Main/main.cpp
- Revision:
- 2:0f91b789d90a
- Parent:
- 0:d5312060f649
diff -r 76241e21ec61 -r 0f91b789d90a Main/main.cpp
--- a/Main/main.cpp Mon Mar 13 07:01:51 2017 +0000
+++ b/Main/main.cpp Mon Jul 10 10:07:01 2017 +0000
@@ -22,7 +22,7 @@
AnalogIn pot_2(p17);
Tone speaker(p18);
-ShiftReg shift;
+ShiftReg sevenSeg;
int main()
{
@@ -41,10 +41,10 @@
mode_B();
}
if (button_c.read() == 1) {
- mode_C();
+
}
if (button_d.read() == 1) {
- mode_D();
+
}
// delay to prevent multiple button presses being detected
@@ -60,8 +60,12 @@
green_led = 1.0;
blue_led = 1.0;
+ // set led PWM frequency
+ float frequency = 100.0f;
+ red_led.period(1.0f/frequency);
+
// turn off 7-seg display
- shift.write(0x00);
+ sevenSeg.write(0x00);
// initialise LCD
lcd.init();
@@ -80,19 +84,16 @@
lcd.printString("to select",0,1);
lcd.printString("A: Mode A",0,2);
lcd.printString("B: Mode B",0,3);
- lcd.printString("C: Mode C",0,4);
- lcd.printString("D: Mode D",0,5);
lcd.refresh();
}
void welcome()
{
lcd.clear();
- lcd.printString(" Automotive",0,0);
- lcd.printString(" Electronics",0,1);
- lcd.printString(" Simulator",0,2);
- lcd.printString("Craig A. Evans",0,4);
- lcd.printString(" 0123456789",0,5);
+ lcd.printString(" UKESF",0,1);
+ lcd.printString(" Headstart",0,2);
+ lcd.printString(" Demo Board",0,3);
+ lcd.printString("YOUR NAME HERE",0,4);
lcd.refresh();
wait(5.0);
}
\ No newline at end of file
