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: mbed
main.hpp
- Committer:
- liam_grazier
- Date:
- 2019-07-11
- Revision:
- 0:951442bd3f7f
- Child:
- 1:5b491fa83cb7
File content as of revision 0:951442bd3f7f:
#ifndef __main__
#define __main__
DigitalIn clockin(PB_0);
DigitalIn runsw(PC_0);
DigitalIn loopsw(PC_1);
AnalogIn analog_valuea(PA_0);
AnalogIn analog_valueb(PA_4);
AnalogIn analog_valuec(PB_1);
DigitalOut led(PC_2);
BusOut multiplexa(PC_4,PC_5,PC_6);
BusOut multiplexb(PC_7,PC_8,PC_9);
BusOut multiplexc(PC_10,PC_11,PC_12);
DigitalOut ledclock(PB_10);
DigitalOut ledlatch(PB_12);
DigitalOut leddata(PB_11);
DigitalOut run(PC_2);
DigitalOut loop(PC_3);
DigitalOut trigout(PA_5);
SPI dac(PB_5,PB_4,PB_3);
DigitalOut cs(PB_9);
bool c;
bool cshp;
bool d;
bool dshp;
bool e;
bool f;
bool fshp;
bool g;
bool gshp;
bool a;
bool ashp;
bool b;
bool sixteenth;
bool eighth;
bool quater;
bool half;
bool one;
bool two;
bool negtwo;
bool negone;
bool zero;
bool plusone;
bool plustwo;
void updateled(void){
ledlatch = 1;
ledlatch = 0;
leddata = sixteenth; //LABEL 1/16
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = eighth; //LABEL 1/8
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = quater; //LABEL 1/4
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = half; //LABEL 1/2
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = one; //LABEL 1
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = two; //LABEL 2
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = negtwo; //LABEL -2
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = negone; //LABEL -1
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = zero; //LABEL = 0
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = plusone; //LABEL 1
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = plustwo; //LABEL 2
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = 0; //LABEL no
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = 1; //LABEL no
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = 1; //LABEL no
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = 0; //LABEL no
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = b; //LABEL B
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = ashp; //LABEL A#
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = a; //LABEL A
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = gshp; //LABEL G#
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = g; //LABEL G
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = fshp; //LABEL F#
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = f; //LABEL F
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = e; //LABEL E
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = dshp; //LABEL D#
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = d; //LABEL D
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = cshp; //LABEL C#
ledclock = 1;
ledclock = 0;
leddata = 0;
leddata = c; //LABEL C
ledclock = 1;
ledclock = 0;
leddata = 0;
}
void allledon(void){
c=1;
cshp=1;
d=1;
dshp=1;
e=1;
f=1;
fshp=1;
g=1;
gshp=1;
a=1;
ashp=1;
b=1;
sixteenth=1;
eighth=1;
quater=1;
half=1;
one=1;
two=1;
negtwo=1;
negone=1;
zero=1;
plusone=1;
plustwo=1;
run = 0;
loop = 0;
}
#endif