Nucleo driving Multiple 4 digit 7 segment display
Dependents: MutiplexedDisplaysSocketServer mltiplexed_7_segment_displays_over_ethernet mltiplexed_7_segmt_displays_ethernet Multi_7_Seg
Revision 0:e5e550b7a341, committed 2018-08-14
- Comitter:
- shivanandgowdakr
- Date:
- Tue Aug 14 12:24:05 2018 +0000
- Child:
- 1:85ec0f240cb8
- Commit message:
- Multiplexing 8 4 digit seven segment displays using SN74CBT3257 ; ;
Changed in this revision
| SN74CBT3257.cpp | Show annotated file Show diff for this revision Revisions of this file |
| SN74CBT3257.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SN74CBT3257.cpp Tue Aug 14 12:24:05 2018 +0000
@@ -0,0 +1,112 @@
+#include "SN74CBT3257.h"
+#include "mbed.h"
+
+
+SN74CBT3257::SN74CBT3257(PinName S0, PinName S1, PinName S2, PinName S3, PinName OEB0, PinName OEB1,PinName OEB2, PinName OEB3) :
+mS0(S0), mS1(S1), mS2(S2), mS3(S3),mOE0(OEB0),mOE1(OEB1),mOE2(OEB2),mOE3(OEB3)
+{
+ mS0=1;
+ mOE0=1;
+ mS1=1;
+ mOE1=1;
+ mS2=1;
+ mOE2=1; // Disable All Floors
+ mS3=1;
+ mOE3=1;
+}
+
+
+ void SN74CBT3257::Select_Floor_Zero(void)
+ {
+ mS0=0;
+ mOE0=0; //Out Enable Floor Zero
+ mS1=1;
+ mOE1=1; // Disable All Other Floors
+ mS2=1;mOE2=1; mS3=1;mOE3=1;
+
+
+ }
+
+
+
+ void SN74CBT3257::Select_Floor_One(void)
+ {
+ mS0=1;
+ mOE0=0; //Out Enable Floor One
+ mS1=1;mOE1=1; mS2=1;
+ mOE2=1; // Disable All Other Floors
+ mS3=1; mOE3=1;
+
+ }
+
+
+ void SN74CBT3257::Select_Floor_Two(void)
+ {
+ mS0=1;
+ mOE0=1;
+ mS1=0;
+ mOE1=0; //Out Ensable Floor Two
+ mS2=1;
+ mOE2=1; // Disable All Other Floors
+ mS3=1;
+ mOE3=1;
+ }
+
+
+
+ void SN74CBT3257::Select_Floor_Three(void)
+ {
+ mS0=1;
+ mOE0=1;
+ mS1=1;
+ mOE1=0; //Out Enable Floor Three
+ mS2=1;
+ mOE2=1; // Disable All Other Floors
+ mS3=1;
+ mOE3=1;
+ }
+
+
+ void SN74CBT3257::Select_Floor_Four(void)
+ {
+ mS0=1;
+ mOE0=1;
+ mS1=1;
+ mOE1=1;
+ mS2=0; //Out Enable Floor Four
+ mOE2=0; // Disable All Other Floors
+ mS3=1;
+ mOE3=1;
+ }
+
+
+
+ void SN74CBT3257::Select_Floor_Five(void)
+ {
+ mS0=1;mOE0=1; mS1=1; mOE1=1;
+ mS2=1; //Out Enable Floor Five
+ mOE2=0; // Disable All Other Floors
+ mS3=1;
+ mOE3=1;
+
+ }
+
+
+ void SN74CBT3257::Select_Floor_Six(void)
+ {
+ mS0=1; mOE0=1; mS1=1; mOE1=1;
+ mS2=1;
+ mOE2=1; // Disable All Other Floors
+ mS3=0; //Out Enable Floor Six
+ mOE3=0;
+ }
+
+
+ void SN74CBT3257::Select_Floor_Seven(void)
+ {
+ mS0=1; mOE0=1; mS1=1; mOE1=1;
+ mS2=1;
+ mOE2=1; // Disable All Other Floors
+ mS3=1; //Out Enable Floor Seven
+ mOE3=0;
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SN74CBT3257.h Tue Aug 14 12:24:05 2018 +0000
@@ -0,0 +1,36 @@
+
+
+#ifndef SN74CBT3257_H
+#define SN74CBT3257_H
+
+#include "mbed.h"
+
+
+class SN74CBT3257 {
+ public:
+
+
+
+ SN74CBT3257(PinName S0, PinName S1, PinName S2, PinName S3, PinName OEB0, PinName OEB1,PinName OEB2, PinName OEB3);
+ void Select_Floor_Zero(void);
+ void Select_Floor_One(void);
+ void Select_Floor_Two(void);
+ void Select_Floor_Three(void);
+ void Select_Floor_Four(void);
+ void Select_Floor_Five(void);
+ void Select_Floor_Six(void);
+ void Select_Floor_Seven(void);
+
+ private:
+ DigitalOut mS0;
+ DigitalOut mS1;
+ DigitalOut mS2;
+ DigitalOut mS3;
+ DigitalOut mOE0;
+ DigitalOut mOE1;
+ DigitalOut mOE2;
+ DigitalOut mOE3;
+
+};
+
+#endif
\ No newline at end of file