Untitled
unknown
plain_text
3 years ago
292 B
10
Indexable
//code calcuate value of number to power of3
// display the result to the 8leds by using sub prog
unsigned int x;
int i;
void display(){
for(i=0;i<=2;i++)
x*=x;
portb=x;
portd.f7=1;
}
void main(){
trisb=0x00;
trisd=0x0f;
trisd.f7=0;
while(1){
x=portd;
display();
}
}Editor is loading...