Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

NIOS 2 alt_up_charactor_lcd to display variables C program

$
0
0
hey guys i need help with this i know how write to the LCD display, i just don know how to get my variables to display if you check my code you will see what i mean.

Code:

#include "altera_up_avalon_character_lcd.h"
#include "altera_up_avalon_character_lcd_regs.h"
int main(){

/* other part of program
*
*
*here
*
*
*/

static int percent;

percent = (rddata * 100)/511; // rddatta is from other part of code


alt_up_character_lcd_dev * char_lcd_dev;
char_lcd_dev = alt_up_character_lcd_open_dev ("/dev/LCD");
alt_up_character_lcd_init(char_lcd_dev);
alt_up_character_lcd_string(char_lcd_dev,"% reflection "); //first line of text to display
alt_up_character_lcd_set_cursor_pos(char_lcd_dev,13,0);// move cursor to where i want to place variable percent

/* this is where i need help, hw do i display my variable??
*is the format i need something like this
*
*alt_up_character_lcd_write(char_lcd_dev, percent);
*
*/

IMG_0900[1].jpg
Attached Images

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>