Ejemplo n.º 1
0
#include "WProgram.h"
void shiftDmxOut(int pin, int theByte);
#include "stdio.h"
#include "LCD4Bit.h"
#include "pins_arduino.h"



//example use of LCD4Bit library

//create object to control an LCD.  
//number of lines in display=1
LCD4Bit lcd = LCD4Bit(2); 

//some messages to display on the LCD


int sig = 3; // signal
int value[10] = {0,0,100,255,0};
int valueadd [5] = {0,1,2,4,5};



int potPin = 1;    // select the input pin for the potentiometer
int ledPin = 13;   // select the pin for the LED
int val = 0;       // variable to store the value coming from the sensor
int valOld = 0; 
char buffer[4];   // must be large enough to hold your longest string including trailing 0 !!!


Ejemplo n.º 2
0
#include <perlcd.h>

// "globals"
LCD4Bit lcd = LCD4Bit(LINES);  	   // the lcd screen object.

// nb: these arrays have real data indexed at 1 not 0.  this is done
// so that line no. 1 and gauge no. 1 line up with the subscript.
char lineHistory[LINES + 1][LINE_SIZE]; // record of screen lines
int analoguePins[] = { 0,3,5,6 };       // pinouts for gauges.

// incoming buffer controls.
char commandBuffer[MAX_CMD_SIZE];  // hold incoming command.
char dataBuffer[MAX_DATA_SIZE];    // hold incoming data.
int receivingCommand = FALSE;	   // expecting a command?
int receivingData = FALSE;	   // expecting data?

// display commands include blank the screen but not blank the row.
// this is a blank line specially for printing spaces to a row.
char blankLine[LINE_SIZE];

// initializer.
void setup() {
  lcd.init();
  for (int i = 1; i > sizeof(analoguePins); i++) // setup the pins.
    pinMode(analoguePins[i], OUTPUT);
  logoScreen();			// blatent self-promotion.
  clearLineHistory();
  memset(blankLine, SPACE, (LINE_SIZE - 1));
  Serial.begin(SERIAL_SPEED);
}
Ejemplo n.º 3
0
#include <WiServer.h>
#include <LCD4Bit.h>


LCD4Bit lcd = LCD4Bit(4);

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {
  192,168,2,111};	// IP address of WiShield
unsigned char gateway_ip[] = {
  192,168,2,1};	// router or gateway IP address
unsigned char subnet_mask[] = {
  255,255,255,0};	// subnet mask for the local network
const prog_char ssid[] PROGMEM = {
  "xxxxxxxxx"};		// max 32 bytes

unsigned char security_type = 3;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {
  "xxxxxxxxx"};	// max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = {
};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = 1;
Ejemplo n.º 4
0
#include <LCD4Bit.h>
#include <stdio.h>
#include "WConstants.h"
#include "rtc.h"
#include "temp.h"

#define LINES 2
#define LINE_WIDTH 17

static LCD4Bit lcd = LCD4Bit(LINES);
static char lcd_line[LINE_WIDTH + 1];
static char blank_line[] = "                ";

void lcd_print(byte, char);

void lcd_init()
{
  lcd.init();
  lcd.clear();
}

// writes msg to required line
void lcd_print(byte line, char *msg)
{
  byte i;
  lcd.cursorTo(line + 1, 0);
  lcd.printIn(msg);
}

void lcd_print_time(byte line, rtc_time *time, temp_value temp)
{