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: HEPTA_CDH HEPTA_COM HEPTA_EPS HEPTA_SENSOR mbed
main.cpp
- Committer:
- HeptaSatTraining2019
- Date:
- 2019-08-21
- Revision:
- 24:3659e0c223c8
- Parent:
- 21:92c25e853b87
- Child:
- 25:ccc5ff675e0c
File content as of revision 24:3659e0c223c8:
#include "mbed.h"
#include"HEPTA_EPS.h"
#include"HEPTA_CDH.h"
#include"HEPTA_SENSOR.h"
#include"HEPTA_COM.h"
#include "mbed.h"
Serial pc(USBTX,USBRX);
DigitalOut myleds[] = {LED1,LED2,LED3,LED4};;
int rcmd = 0,cmdflag = 0;
void commandget()
{
rcmd=pc.getc();
cmdflag = 1;
}
void receive(int *xrcmd, int *xcmdflag)
{
pc.attach(commandget,Serial::RxIrq);
*xrcmd = rcmd;
*xcmdflag = cmdflag;
}
void initialize()
{
rcmd = 0;
cmdflag = 0;
}
int main()
{
pc.baud(9600);
receive(&rcmd,&cmdflag);
while(1) {
myleds[0] = 1;
wait(0.5);
myleds[0] = 0;
wait(0.5);
if (cmdflag == 1) {
if (rcmd == 'a') {
//Please enter your answer in this part
//
}
initialize();
}
}
}