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.
main.cpp
- Committer:
- lanfear
- Date:
- 2015-02-26
- Revision:
- 0:a085abcfd4f8
File content as of revision 0:a085abcfd4f8:
#include "mbed.h"
DigitalIn Button1(p21);
DigitalOut led1(LED1);
AnalogIn Joystick1(p18);
AnalogIn Ain3(p15);
float LFT;
int LowBatteryCounter=0;
Ticker VoltageCheck_tick;
void LowBatteryShutDown(void);
int main()
{
VoltageCheck_tick.attach(&LowBatteryShutDown,0.5);
while(1)
{
if (Button1==1)
{
LFT = Joystick1;
}
}
}
void LowBatteryShutDown(void)
{
led1 = !led1;
if(Ain3<=0.81)
{
LowBatteryCounter++;
}
}