March 28, 2012

Digital Volt meter with seven segment display

Previous I post about Digital Volt meter with LCD display. This project I modification become Digital Volt meter with seven segment display. For more information about this project you can check at Digital Volt meter with LCD display.



The code:
 
$regfile = "m8535.dat"
$crystal = 8000000

Config Portb = Output
Config Portd = Output
Config Adc = Single , Prescaler = Auto

Start Adc

Dim Read_adc As Word
Dim Volt As Single
Dim Volt1 As Integer
Dim Bit4 As Integer
Dim Bit3 As Integer
Dim Bit2 As Integer
Dim Bit1 As Integer
Dim B1 As Byte

Do
Read_adc = Getadc(0)
Volt = Read_adc / 1023
Volt = Volt * 30
Volt = Volt * 100
Volt1 = Volt

Bit4 = Volt1 / 1000
B1 = Lookup(bit4 , Dta)
Portd = &B00001000
Portb = B1

Bit3 = Volt1 / 100
Bit3 = Bit3 Mod 10
B1 = Lookup(bit3 , Dta)
Portd = &B00000100
Portb = B1

Bit2 = Volt1 / 10
Bit2 = Bit2 Mod 10
B1 = Lookup(bit2 , Dta)
Portd = &B00000010
Portb = B1

Bit1 = Volt1 Mod 10
B1 = Lookup(bit1 , Dta)
Portd = &B00000001
Portb = B1
Loop

Dta:
Data &H40 , &H79 , &H24 , &H30 , &H19 , &H12 , &H02 , &H78 , &H00 , &H10

1 comment:

  1. Low-priced digital voltmeters may be good enough for most of your needs because of the improved digital technology and quality of test equipment. Higher-priced digital voltmeters usually have special features that are needed for a specific use. Some digital voltmeters have special functions, such as measuring temperature or current by using a specially customized digital accessory probe.

    ReplyDelete

Let's us sharing

Recent Comment

Grab This Widget