NEWBIE : Need help graphing an Analog signal

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
LittleMenotti
Posts: 1
Joined: 24 Apr 2021 16:03

NEWBIE : Need help graphing an Analog signal

#1 Post by LittleMenotti » 24 Apr 2021 18:17

Hi !
Im using a PIC18F4550 and a ILI9341. I need to display a graph representing a sine signal in the analog port like in the picture i attached. So far i have this :

while(1) {

vala = adc_read(0);
valab = vala*5.0 / 1023;
vpos = valab+90;
display_setCursor(i, vpos);
i++;
display_puts(".");
delay_ms(500);
display_setTextSize(0);

}

}

Its worth noting that im using the GFX library.
While this kinda works, im sure its not the most optimized way. Also, I need to refresh the graph each time it reaches the end.
Any suggestions are welcome, thank you!
Attachments
PIC.PNG
PIC.PNG (721.4 KiB) Viewed 1149 times
:D

Post Reply

Return to “mikroPascal PRO for ARM General”