0 Members and 2 Guests are viewing this topic.
90110000 - LED * 90110B00 (R/W): Control register o Bit 0: Set this bit to enable green light blink data. If green blink data iteration is not on, the green light state is read from bit 0 of green blink data. o Bit 1: Set this bit and bit 6 to enable green blink data iteration. o Bit 2: Set this bit to force green light off. Overrides bit 4. o Bit 3: Set this bit to force red light off. Overrides bits 5 and 13. o Bit 4: Set this bit to force green light on. o Bit 5: Set this bit to force red light on. o Bit 6: See this bit and bit 1 to enable green blink data iteration. Reset before modifying green blink data or delay. o Bit 9: Set this bit to enable red light blink data. If red blink data iteration is not on, the red light state is read from bit 0 of red blink data. o Bit 10: Set this bit and bit 12 to enable red blink data iteration. o Bit 12: Set this bit and bit 10 to enable red blink data iteration. Reset before modifying red blink data or delay. o Bit 13: Forces red light on if bit 4 is 0, or red light off if bit 4 is 1. (?) * 90110B04 (R/W): Green blink data. 32 bits of on and off state, represented by 1 and 0. Iteration is done from bit 31 to bit 0 repeatedly. * 90110B08 (R/W): Green blink delay (negative). OS sets this to -2048. * 90110B0C (R/W): Red blink data. 32 bits of on and off state, represented by 1 and 0. Iteration is done from bit 31 to bit 0 repeatedly. * 90110B10 (R/W): Red blink delay (negative). OS sets this to -2048. Note: If red and green lights are on at the same time, the color becomes yellow.
#include <os.h>#include "console.h"#include "screen.h"#include "charmap.h"#define LED_MODE_ADDR 0x90110B00int getMem(int addr){ return *(volatile unsigned*) addr;}void setMem(int addr, int val){ *(volatile unsigned*) addr = val;}int main(int argc, char* argv[]){ int mode_orig = getMem(LED_MODE_ADDR); int mode_base = mode_orig&~0b01011001111111; //turn OFF + disable blink / iteration / force on-off clrScr(); int mode_curr=mode_base; int mode_last=mode_orig; while(!isKeyPressed(KEY_NSPIRE_ESC)) { mode_curr=mode_base; if(isKeyPressed(KEY_NSPIRE_R) || isKeyPressed(KEY_NSPIRE_J) || isKeyPressed(KEY_NSPIRE_Y)) mode_curr |= 0b100000; // force RED on if(isKeyPressed(KEY_NSPIRE_V) || isKeyPressed(KEY_NSPIRE_G) || isKeyPressed(KEY_NSPIRE_J) || isKeyPressed(KEY_NSPIRE_Y)) mode_curr |= 0b010000; // force GREEN on if(mode_curr!=mode_last) { setMem(LED_MODE_ADDR,mode_curr); mode_last = mode_curr; disp("Written LED mode: ",0); dispi(mode_curr,0); displn("",0); disp("Current LED mode: ",0); dispi(getMem(LED_MODE_ADDR),0); displn("",0); } } setMem(LED_MODE_ADDR,mode_orig); // reset return 0;}
Written LED mode: 0 // 1st loopCurrent LED mode: 5699Written LED mode: 32 // press 'R' keyCurrent LED mode: 5699Written LED mode: 0 // release 'R' keyCurrent LED mode: 5699
set_led(int color) {*(volatile unsigned*) 0x90110B00=color<<4;}
(don't do it, unless you have a second TI-Nspire to unlock it)
I'm curious what would happen if you run your program during PPT (if Ndless works in PPT), I would test it myself but I have a touchpad cas... so no Ndless.
Ah I see. I take it that they would get mad if someone messed with PTT and got it disabled, as it could get the calcs banned from school?
no Ryes Ge Ys RRa RGi RYt RRn GGr GYu GRl YGo YYd RRRc RRGp RRYm RRRv RGGq RGYf RGRb RYGg RYYh RYRj GRGx GRYy GRRz GGGw GGYk GGR0 GYG1 GYY2 GYR3 YRG4 YRY5 YRR6 YGG7 YGY8 YGR9 YYGrepeat YYY