Exemplo n.º 1
0
/*
 * main.c
 */
void main() {
	init_pins();
	init_button();
	init_adc();
	init_wdt();
	WDT_delay = CURRENT_DELAY;

 	BCSCTL1 = CALBC1_8MHZ;
	DCOCTL =  CALDCO_8MHZ;

	LCD_setup();
	_bis_SR_register(GIE);	// enable interrupts
	// initialize LCD and say hello a few times :-)
	LCD_init();

	LCD_send_string((char*)msg);

	while(1){
		LCD_put(0x80+40); // cursor to line 2, first position
		snprintf(hex, 20, HEX, (int)colourArray[1], (int)colourArray[2], (int)colourArray[0]);
		LCD_send_string(hex);
	}

	_bis_SR_register(LPM0_bits);

	//delay(0); // maximum delay



}
Exemplo n.º 2
0
Arquivo: lcd.c Projeto: j3557o/raspify
static void PutBitsOnPins(char bits) {
  if (lcd_connected == -1) {
    LCD_setup();
  }
  if (lcd_connected == 1) {
    char buf[1];
    buf[0] = bits;
    if (write(fd,buf,1) != 1) {
      printf("Failed to write to the i2c bus.\n");
      lcd_connected = 0;
    }
  }
}
Exemplo n.º 3
0
// Setup
inline void Scan_setup()
{
    // Setup UART Connect, if Output_Available, this is the master node
    Connect_setup( Output_Available );

    // Setup GPIO pins for matrix scanning
    Matrix_setup();

    // Setup ISSI chip to control the leds
    LED_setup();

    // Setup the ST/NHD lcd display
    LCD_setup();

    // Reset scan count
    Scan_scanCount = 0;
}