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
src/main.cpp
- Committer:
- Slord2142
- Date:
- 2019-03-09
- Revision:
- 41:bd54c88e3334
- Parent:
- 32:05a15c208bfb
- Child:
- 42:3ae73b61f657
File content as of revision 41:bd54c88e3334:
//-------------------------------------------------------------------------------
//
// Treehouse Designs Inc.
// Colorado Springs, Colorado
//
// Copyright (c) 2018 by Treehouse Designs Inc.
// Copyright (c) 2018 by Agility Power Systems Inc.
//
// This code is the property of Treehouse Designs, Inc. (Treehouse) and
// Agility Power Systems Inc. (Agility) and may not be redistributed
// in any form without prior written permission from
// both copyright holders, Treehouse and Agility.
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
//-------------------------------------------------------------------------------
//
// REVISION HISTORY:
//
// $Author: $
// $Rev: $
// $Date: $
// $URL: $
//
//-------------------------------------------------------------------------------
#include "mbed.h"
#include "PortOut.h"
#include "all_io.h"
//DigitalOut myled(LED1);
Ticker slowClk;
Ticker fastClk;
#define TRUE 1
#define FALSE 0
volatile bool dosFlip = FALSE;
volatile bool dofFlip = FALSE;
void slowFlip() {
dosFlip = TRUE;
}
void fastFlip() {
dofFlip = TRUE;
}
void initOut(void){
ec2 = 1;
ec15 = 1;
ec26 = 1;
ec6 = 1;
ec12 = 1;
ec25 = 1;
ec36 = 1;
ec31 = 1;
ec9 = 1;
ec5 = 1;
ec24 = 1;
ec11 = 1;
ec1 = 1;
ec10 = 1;
ec23 = 1;
ec7 = 1;
ec18 = 1;
ec14 = 1;
ec27 = 1;
ec19 = 1;
ec32 = 1;
ec35 = 1;
ec21 = 1;
ec30 = 1;
ec33 = 1;
ec20 = 1;
ec34 = 1;
ec29 = 1;
ec8 = 1;
ec4 = 1;
ec17 = 1;
ec13 = 1;
ec26 = 1;
ec22 = 1;
}
void flipSlow(void){
dosFlip = FALSE;
if(!ILR_enable){
ec2 = !ec2;
ec15 = !ec15;
ec26 = !ec26;
ec6 = !ec6;
ec12 = !ec12;
ec25 = !ec25;
ec36 = !ec36;
ec31 = !ec31;
ec9 = !ec9;
ec5 = !ec5;
ec24 = !ec24;
ec11 = !ec11;
ec1 = !ec1;
ec10 = !ec10;
ec23 = !ec23;
ec7 = !ec7;
ec18 = !ec18;
ec14 = !ec14;
ec27 = !ec27;
ec19 = !ec19;
ec32 = !ec32;
ec35 = !ec35;
ec21 = !ec21;
ec30 = !ec30;
ec33 = !ec33;
ec20 = !ec20;
ec34 = !ec34;
ec29 = !ec29;
ec8 = !ec8;
ec4 = !ec4;
ec17 = !ec17;
ec13 = !ec13;
ec26 = !ec26;
ec22 = !ec22;
}
}
void flipFast(void){
dofFlip = FALSE;
if(ILR_enable){
ec2 = !ec2;
ec15 = !ec15;
ec26 = !ec26;
ec6 = !ec6;
ec12 = !ec12;
ec25 = !ec25;
ec36 = !ec36;
ec31 = !ec31;
ec9 = !ec9;
ec5 = !ec5;
ec24 = !ec24;
ec11 = !ec11;
ec1 = !ec1;
ec10 = !ec10;
ec23 = !ec23;
ec7 = !ec7;
ec18 = !ec18;
ec14 = !ec14;
ec27 = !ec27;
ec19 = !ec19;
ec32 = !ec32;
ec35 = !ec35;
ec21 = !ec21;
ec30 = !ec30;
ec33 = !ec33;
ec20 = !ec20;
ec34 = !ec34;
ec29 = !ec29;
ec8 = !ec8;
ec4 = !ec4;
ec17 = !ec17;
ec13 = !ec13;
ec26 = !ec26;
ec22 = !ec22;
}
}
void checkFlip(void){
if(dosFlip){
flipSlow();
}
if(dofFlip){
flipFast();
}
}
int main() {
initOut();
slowClk.attach(&slowFlip, 0.0003);
fastClk.attach(&fastFlip, 0.00001);
while(1){
checkFlip();
}
}