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.
Startup/startup.cpp@10:258a1eca02cc, 2020-05-06 (annotated)
- Committer:
- lukeocarwright
- Date:
- Wed May 06 19:51:22 2020 +0000
- Revision:
- 10:258a1eca02cc
- Parent:
- 7:33cb5f2db1ee
- Child:
- 12:7a399a476cfd
Added Triangle/saw LUT with debug test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lukeocarwright | 7:33cb5f2db1ee | 1 | #include "mbed.h" |
lukeocarwright | 7:33cb5f2db1ee | 2 | #include "startup.h" |
lukeocarwright | 7:33cb5f2db1ee | 3 | |
lukeocarwright | 7:33cb5f2db1ee | 4 | //objects |
lukeocarwright | 7:33cb5f2db1ee | 5 | LUTs lut; |
lukeocarwright | 7:33cb5f2db1ee | 6 | |
lukeocarwright | 7:33cb5f2db1ee | 7 | |
lukeocarwright | 7:33cb5f2db1ee | 8 | //constructor/destructor |
lukeocarwright | 7:33cb5f2db1ee | 9 | startup::startup() |
lukeocarwright | 7:33cb5f2db1ee | 10 | { |
lukeocarwright | 7:33cb5f2db1ee | 11 | } |
lukeocarwright | 7:33cb5f2db1ee | 12 | startup::~startup() |
lukeocarwright | 7:33cb5f2db1ee | 13 | { |
lukeocarwright | 7:33cb5f2db1ee | 14 | } |
lukeocarwright | 7:33cb5f2db1ee | 15 | |
lukeocarwright | 7:33cb5f2db1ee | 16 | //methods |
lukeocarwright | 7:33cb5f2db1ee | 17 | void startup::initialise(N5110 &lcd, Gamepad &pad) |
lukeocarwright | 7:33cb5f2db1ee | 18 | { |
lukeocarwright | 7:33cb5f2db1ee | 19 | pad.init(); //initiate Gamepad |
lukeocarwright | 7:33cb5f2db1ee | 20 | printf("Initialising Pad\n"); |
lukeocarwright | 7:33cb5f2db1ee | 21 | lcd.init(); //intitates screen |
lukeocarwright | 7:33cb5f2db1ee | 22 | lcd.clear(); |
lukeocarwright | 7:33cb5f2db1ee | 23 | lcd.setContrast(0.5); //contrast setting |
lukeocarwright | 7:33cb5f2db1ee | 24 | lcd.inverseMode(); //puts screen in -ve |
lukeocarwright | 7:33cb5f2db1ee | 25 | //Prints CART SYNTH to display |
lukeocarwright | 7:33cb5f2db1ee | 26 | lcd.printString("CART",12,2); |
lukeocarwright | 7:33cb5f2db1ee | 27 | lcd.printString("SYNTH",32,3); |
lukeocarwright | 7:33cb5f2db1ee | 28 | lcd.refresh(); |
lukeocarwright | 10:258a1eca02cc | 29 | lut.initial_wavetables(); |
lukeocarwright | 7:33cb5f2db1ee | 30 | wait_ms(1000); //timer to allow theme to play out |
lukeocarwright | 7:33cb5f2db1ee | 31 | lcd.clear(); |
lukeocarwright | 7:33cb5f2db1ee | 32 | lcd.refresh(); //sets clear screen |
lukeocarwright | 7:33cb5f2db1ee | 33 | } |