OK it's been a while. I've been focusing on learning ICE but since ICE doesn't support GetLCDBrightness() (yet) Mateo convinced me to do it in C. Problem is, the closest language to C I know is C#. Enough excuses, here's what I've got.
Code: // Program Name: GETLCD
// Author(s): TLM
// Description: Gets brightness level and stores it into Ans
// I didn't know which ones I needed, so I included all of them.
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
/* Keep these headers */
#include <tice.h>
/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fileioc.h>
/* Other available headers */
// including stdarg.h, setjmp.h, assert.h, ctype.h, float.h, iso646.h, limits.h, errno.h
/* Available libraries */
// including lib/ce/graphc.h, lib/ce/fileioc.h, and lib/ce/keypadc.h
// Sample: #include <lib/ce/graphc.h>
/* Put your function prototypes here */
/* Put all your globals here. */
/* Put all your code here */
void main(void) {
uint8_t i,level;
/* Store the current brightness level into level*/
level = lcd_BacklightLevel;
// Stores the level into Ans
ti_SetVar(TI_REAL_TYPE, ti_Ans, level);
}
/* Other functions */
The compiler errors and says
Code: C CE SDK Version 7.3
Looking for changes...
Z:\opt\csdk\5245BCB2\src\getlcd.c
Z:\OPT\CSDK\5245BCB2\SRC\GETLCD.C (39,38) : ERROR (171) Argument type is not compatible with formal parameter
/include/.makefile:256: recipe for target 'obj/GETLCD.obj' failed
I'm pretty sure that means ti_SetVar( requires 'level' to be a real_t (since that's what the examples have it as) rather than a uint8_t. Unfotunately I have no idea how to type cast this and even with the help of _iPheonix_ and Michael2_3B we couldn't understand it enough to proceed any farther.
So my question is: How do I get the brightness level stored into Ans?