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.
seg_checker.cpp
00001 /* 00002 Title: 7 Segment Checker 00003 Author: David Ross 00004 Date: May 27th, 2016 00005 Description: This program will individually light up segments 00006 a, b, c, ... , h (dot) continually with a 0.5 second 00007 delay between each segment displayed 00008 */ 00009 00010 #include "mbed.h" 00011 00012 // Declaration Section for seven_segs 00013 00014 BusOut seven_segs (D2, D3, D4, D6, D7, D9, D10, D11); // MSB=D11, LSB=D2 00015 int main(void) 00016 { 00017 00018 unsigned char value=0x80; // set value for CC Display 00019 unsigned char temp; // temp value for troubleshooting 00020 for(;;) // loop forever 00021 { 00022 temp= ~value; // invert value for CA display 00023 seven_segs= temp ; // send value to 7 segments 00024 wait_ms(500); // wait 0.5 seconds 00025 value=value >> 1; // shift to select next segment 00026 if(value < 1) // if value is 0 00027 { 00028 value=1; // then reset to 1 00029 do // reverses pattern 00030 { 00031 temp= ~value; // invert for CA display 00032 seven_segs= temp; // send value to 7 sements 00033 wait_ms(500); // wait 0.5 seconds 00034 value = value <<1; // shift to select next segment 00035 }while (value<0x80); // as long as < 0x80 00036 value=0x80; // then reset value to 0x80 00037 } 00038 00039 } 00040 }
Generated on Fri Jul 22 2022 04:20:49 by
1.7.2