Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
EDIT: Brief update - I found some drivers that appear to work here: http://homepage.hispeed.ch/peterfleury/avr-software.html
/****************************************************************************** Copyright (c) 2008 www.societyofrobots.com* (please link back if you use this code!)** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License version 2 as* published by the Free Software Foundation.** Alternatively, this software may be distributed under the terms of BSD* license.*****************************************************************************/#include "lcd.h"void control(void) { lcd_init(LCD_DISP_ON); //Initializes display with no cursor while (1) { delay_ms(1000); lcd_clrscr(); lcd_puts("Line 1"); delay_ms(1000); lcd_clrscr(); lcd_gotoxy(0,1); lcd_puts("Line 2"); delay_ms(1000); lcd_clrscr(); lcd_gotoxy(20,0); //The 4x20 display is actually wired as a lcd_puts("Line 3"); //2x40, so the third line actually starts //on the 20th character of the 1st line delay_ms(1000); lcd_clrscr(); lcd_gotoxy(20,1); //ditto lcd_puts("Line 4"); } }
extern void lcd_putc(char c);extern void lcd_puts(const char *s);
Is it possible to create a string that contains a variable's value and then pass it's pointer to the lcd_puts() function?
#include <string.h>char string_set[] = "hello world im 2 days oldx";while(string_set[i] != x){lcd_putc(string_set[i]);i++;}
int sensor_val = 224;lcd_puts("Sensor value = ");lcd_putc(sensor_val);
lcd_putc(sensor_val & 0x0F);//&0x0F strips ascii off to use in char strings
char buffer[40]; //40 column lcdint sensor_val = 224;lcd_puts("Sensor value = ");lcd_puts( itoa(sensor_val, buffer, 10) ); //variable, string to use, base to use