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.
Dependents: MFS_ADC MFS-7_Segment-Interrupt MFS_USART_Test_HAL MFS_02-Luftschlange ... more
Diff: MFS.cpp
- Revision:
- 7:99c81cc5ddbc
- Parent:
- 6:c7907f21fe02
- Child:
- 9:8924db86f383
--- a/MFS.cpp Tue Mar 02 13:28:08 2021 +0000
+++ b/MFS.cpp Mon Mar 08 08:58:12 2021 +0000
@@ -95,12 +95,24 @@
void MFS::operator=(unsigned int wert)
{
- dieSegmente=(~wert)&0xFF;
+ char hilf=0, hilf2=wert;
+ for (int i=0;i<8;i++)
+ {
+ hilf=(hilf<<1)+hilf2%2;
+ hilf2=hilf2/2;
+ }
+ dieSegmente=(~hilf)&0xFF;
dieAuswahl=(wert/0x100);
send();
}
MFS::operator int(void)
{
- return dieAuswahl*0x100+~dieSegmente;
+ char hilf=0, hilf2=~dieSegmente;
+ for (int i=0;i<8;i++)
+ {
+ hilf=(hilf<<1)+hilf2%2;
+ hilf2=hilf2/2;
+ }
+ return dieAuswahl*0x100+hilf;
}
\ No newline at end of file