1
'''A demonstration program for GCGB and GCB.
2
'''--------------------------------------------------------------------------------------------------------------------------------
3
'''This program will display the value of a potentiometer, respresenting a light sensor, on a 7 Segment display.
4
'''The 7 Segment display is connected to connection PORTB7-PORTB0 for segments A-G respectively.
5
'''The 7 Segment display enable pin connected to PORTC.7.
6
'''A potentiometer is connected to port A0.
7
'''@author EvanV plus works of HughC
11
'''********************************************************************************
13
''' Modified by Santiago Gonzalez
19
#config HS_OSC, WDT_OFF, LVP_OFF
21
; ----- Define Hardware settings
27
; You need to specify the port settings
29
#define DISP_SEG_A PORTB.7
30
#define DISP_SEG_B PORTB.6
31
#define DISP_SEG_C PORTB.5
32
#define DISP_SEG_D PORTB.4
33
#define DISP_SEG_E PORTB.3
34
#define DISP_SEG_F PORTB.2
35
#define DISP_SEG_G PORTB.1
36
#define DISP_SEG_DOT PORTB.0
37
#define DISP_SEL_1 PORTC.7
40
' No Variables specified in this example. All byte variables are defined upon use.
43
; ----- Main body of program commences her
46
Value = ReadAD(AN0)/26
47
DisplayValue( 1, Value )