Code: Select all
#option _Segment_Port = PORTC // Define the 7 Segment PORT
#option _Segment_TRIS = GetTRIS(_Segment_Port) // Nice way to automatically get the TRIS of a PORT
// automatically from a selected port
Dim
Segment_Data As _Segment_Port, // Make Alias’s from the compiler options
Segment_TRIS As _Segment_TRIS
Segment_TRIS = %00000000 // Make the 7-segment pins all outputs
Segment_Data = %00000000 // And set them all low
Its small features like the above that make it that much easier to make generic user modules a lot better