Course Solutions Uncategorized (Solved) : Already Made Source Sound Scale Cdefgabc Rae Mi Fa Sol Ra Si Working Usually Use Codevisio Q29788387 . . . .

(Solved) : Already Made Source Sound Scale Cdefgabc Rae Mi Fa Sol Ra Si Working Usually Use Codevisio Q29788387 . . . .

 

Ialready made a source but the sound scale (cdefgabc do rae mi fasol ra si do ) is not workingI usually use codevision and proteus (simulationprogram)Avr atmega 128Here is my program source help..PORTG is piezzo buser speaker

#include<io.h>
#include<delay.h>
int AD_volt=0;
int position=0,BJT[4]={0xFE,0xFD,0xFB,0xF7};
intnumber=0,segment[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
int msec=0, sec=0, min=0;

void delay(int i) //time delay function
{
while(i–);
}

void main()
{
ADMUX=0x00;
ADCSRA=0x87;
delay_ms(5);

DDRE=0x03;
DDRC=0xFF; //LED control
PORTC=0xFF; //
DDRD=0x00; //
DDRG=0xFF; //setting speaker a
DDRA=0xFF;
PORTA=0XFF;
DDRB=0xFF;
PORTB=0xFF;
DDRD=0x00;
TCCR0=0x04;
TIMSK=0x01;
SREG=0x80;
while(1){
PORTE=0x01;
delay_ms(5000);
PORTE=0x00;
delay_ms(5000);
PORTE=0x02;
delay_ms(5000);
PORTE=0x00;
delay_ms(5000);}
}
interrupt[TIM0_OVF]void timer0_ovf_isr()
{
TCNT0=0x06;
if(PIND==0xFC)
{
AD_volt=(ADCL)+(ADCH<<8); //
ADCSRA=0xC7;
PORTC=(AD_volt>>2);
PORTA=BJT[position]; //this time clock source
if(position==0)number=sec%10;
if(position==1)number=sec/10;
if(position==2)number=min%10;
if(position==3)number=min/10;
PORTB=segment[number];
position++;
if(position>3)position=0;
msec++;
if(msec==1000)
{
msec=0;
sec++;
}
if(sec==60)
{
sec=0;
min++;
}
if(min==60)min=0;
}

//there 8 switch if i press switch 7then led light on and speaker is on (do)

if (PIND==(0x7F))
{PORTC=0x7F;
PORTG=0x00;
delay(3906*0.5); //Do (sound scale of C is 3906)
PORTG=0x01;
delay(3906*0.5);
}
if (PIND==0xBF)
{
PORTC=0xBF;
PORTG=0x00;
delay(3906*0.5333);
PORTG=0x01;
delay(3906*0.5333);
}
if (PIND==0xDF)
{
PORTC=0xDF;
PORTG=0x00;
delay(3906*0.6);
PORTG=0x01;
delay(3906*0.6);
}
if (PIND==0xEF)
{
PORTC=0xEF;
PORTG=0x00;
delay(3906*0.6666);
PORTG=0x01;
delay(3906*0.6666);
}
if (PIND==0xF7)
{
PORTC=0xF7;
PORTG=0x00;
delay(3906*0.75);
PORTG=0x01;
delay(3906*0.75);
}
if (PIND==0xFB)
{
PORTC=0xFB;
PORTG=0x00;
delay(3906*0.8);
PORTG=0x01;
delay(3906*0.8);
}
if (PIND==0xFD)
{
PORTC=0xFD;
PORTG=0x00;
delay(3906*0.8888);
PORTG=0x01;
delay(3906*0.8888);
}
if (PIND==0xFE)
{
PORTC=0xFE;
PORTG=0x00;
delay(3906);
PORTG=0x01;
delay(3906);
}

}

Expert

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Compiler Keep Responding Segmentation Fault 11 Put Numbers Include Int Main Int 10 Declare Q26227868 . . . .(Solved) : Compiler Keep Responding Segmentation Fault 11 Put Numbers Include Int Main Int 10 Declare Q26227868 . . . .

<p>why is my compiler keep responding as Segmentation fault: 11after i put in the numbers.</p><p>#include <stdio.h></p><p>int main()<br/>{<br/>int a[10],i; // declare array and variables<br/>printf("enter the numbers n");<br/>scanf("%d",i);</p><p>// Read the any 10