AC with DC Voltmetter.txt - *Submission When you have...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/*Submission When you have verified the operation of your DC and your AC meters, collect all of the code and combine it together with an input switch to toggle between DC and AC operation. The LCD should display the current meter type and prompt the user to press the switch to change meters. It could say for example, AC Press SW1 for DC in AC operation and DC Press SW1 for AC in DC operation. Be sure that there is a heartbeat displayed on the LCD indicating that the meter is functional. Connect a DC voltage to the meter at PC1 and verify that the meter reads the same value in both modes and then obtain a signature from your instructor. /************************ AC Voltmeter ****************************************/ /* */ /* This routine measures an AC voltage between 0 and 5 volts and displays */ /* the RMS value on an LCD. */ /* */ /* The AC waveform is applied WITH AN OFFSET to PA1. The calculated value */ /* is true RMS so it includes both the DC offset and the AC sinusoid. */ /* */ //************************ Includes ****************************************** #include <avr/io.h> #include <util/delay.h> //************************ Defines ******************************************* #define countdc (unsigned int) 500 #define count (unsigned int) 73 #define SampleCount (unsigned int) 256 //************************ Declarations *************************************** void Sampling (void); void Product(void); void Squareroot(void); unsigned long int Average; LCDstr (char *strg); LCD_Init(); ADC_Init(); Timer_Init(); Port_Init(); unsigned int Samples[]; BCD_Conversion (); char Message[]="Press 1 for DC Press 2 for AC"; char Heart[]= "*"; char Unit[] = "V = "; char Units[] = " V = "; char TestMsg[] = "Test"; char DC[]="DC";
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern