Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / Programming Questions / Documentation for special/system variables/constants? on: February 10, 2013, 06:37:03 pm
Not sure if that's the correct name for them. I mean the variables that access things in the PC when compiling the sketch - things like PC system time.  I also mean variables that access the registers in the arduino  like I found in this example below for interrupts (if I understand how it works, it is directly setting registers in the atmel chip).   I just haven't been able to locate the documentation for them.

Code:
//set timer1 interrupt at 1Hz
  TCCR1A = 0;// set entire TCCR1A register to 0
  TCCR1B = 0;// same for TCCR1B
  TCNT1  = 0;//initialize counter value to 0
  // set compare match register for 1hz increments
  OCR1A = 15624;// = (16*10^6) / (1*1024) - 1 (must be <65536)
  // turn on CTC mode
  TCCR1B |= (1 << WGM12);
  // Set CS10 and CS12 bits for 1024 prescaler
  TCCR1B |= (1 << CS12) | (1 << CS10);  
  // enable timer compare interrupt
  TIMSK1 |= (1 << OCIE1A);
17  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 10, 2013, 05:39:11 pm
ok, thanks.

I have created issue 98 for this: http://code.google.com/p/m2tklib/issues/detail?id=98

Oliver

Much appreciated.  As a beginner, I wasn't sure of the situation with all the various libraries and hardware surrounding the Arduino.   It can all be a bit confusing, but all the support that is available is great.
18  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 10, 2013, 04:57:07 pm
Can you provide a link to the I2C lib? I will check if i can do the porting.

Oliver

The one I have is from  http://www.dfrobot.com/image/data/DFR0154/LiquidCrystal_I2Cv1-1.rar

However, googling it just now, I see others, but they all seem very similar - maybe a common ancestry.
For example
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/LiquidCrystal_V1.2.1.zip
http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip

19  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 07, 2013, 05:03:51 pm
I was starting to come to that conclusion myself.   It seems that nearly all LCD libraries seem to target the non-I2C devices, so although I really like how the I2C display interfaces with only a couple of pins, it makes more work whenever I want to use a library like M2TKLIB.

Thanks for the help.
20  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 07, 2013, 05:00:19 pm
A request: could you change the topic to [solved] and edit the first post to say don't use arduino 1.0.1? Use 1.0, 1.0.3 or 1.5 Thanks.

Done - and thanks again.
21  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 07, 2013, 01:48:22 am
Let's get rid of that version then.


Yep, and thanks for the help.  Being new to this, if you hadn't mentioned other versions of the IDE, I would never have thought to go looking.
22  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 07, 2013, 01:23:04 am

I go to wondering why I have version 1.0.1    Maybe it's just because that was what had been packaged for the distro.   So, I just downloaded 1.5.1 and installed in a temp directory.   It seems to work fine, and it compiles the Phi prompt examples without error too.

So I guess that gets around the problem for me.  Strange how 1.0.1 wouldn't work though...
23  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 07, 2013, 01:04:02 am
I'm puzzled. I can compile with 1.0 and 1.5 so let me get 1.0.3 and try to compile again.

Mine says 1.0.1  and it's running under Ubuntu linux 12.10  if that makes any difference.
24  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 11:13:23 pm
This is what I originally read that I thought might be the problem (only because it is the same/similar error message)

http://code.google.com/p/arduino/issues/detail?id=795

(referred from here  http://arduino.cc/forum/index.php/topic,87186.0.html)
25  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 11:06:00 pm
I've been procrastinating with the formal release 1.0 so the pre-release is the latest working version. The 523 version is not compatible with arduino 1.x. Now that phi_interfaces works, the problem lies in the phi_prompt library. Can you compile a simpler example code such as phi_prompt_example_int? This code has no PROGMEM in it.

Sorry for taking a while - I had to go out.  phi_prompt_example_int gives the following errors...

Quote
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:30:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:31:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:32:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:33:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:34:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:35:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:44: error: variable ‘phi_prompt_lcd_ch_item’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:49: error: ‘phi_prompt_lcd_ch0’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:69: error: ‘phi_prompt_lcd_ch1’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:89: error: ‘phi_prompt_lcd_ch2’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:109: error: ‘phi_prompt_lcd_ch3’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:129: error: ‘phi_prompt_lcd_ch4’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:36:149: error: ‘phi_prompt_lcd_ch5’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:38:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:39:9: error: ‘prog_char’ does not name a type
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:40:30: error: variable ‘yn_items’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:40:34: error: ‘yn_00’ was not declared in this scope
/home/myhome/sketchbook/libraries/phi_prompt/phi_prompt.cpp:40:40: error: ‘yn_01’ was not declared in this scope
26  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 05:47:30 pm
Just wanted to note here, I downloaded the version linked on the web site - v1.0, but it is pre-release.   I see there was an older version - v523 - should I be using that one.
27  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 05:39:24 pm
Mine compiled just fine on arduino 1.0 and 1.5 just now.

Can you compile sample code phi_button_groups_01 inside phi_interfaces library sample code collection? I want to know if this library is working.

Also have you restarted arduino ide (closing all windows) after you install the libraries?

phi_button_groups_01 compiles without problem.  (and yes, the IDE has been restarted)
28  Using Arduino / Displays / M2TKLIB Hello World with LiquidCrystal_I2C on: February 06, 2013, 05:36:47 pm
I am trying to use M2TKLIB with my I2C 20x4 LCD panel.   I tried modifying the hello world program to use the different library...

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "M2tk.h"
#include "utility/m2ghlc.h"

LiquidCrystal_I2C lcd(0x3F,20,4);

M2_LABEL(hello_world_label, NULL, "Hello World!");
M2tk m2(&hello_world_label, NULL, NULL, m2_gh_lc);

void setup() {
  m2_SetLiquidCrystal(&lcd, 16, 2);
}

void loop() {
  m2.draw();
  delay(500);
}


But I get the following errors

Quote
In file included from HelloWorld.cpp:29:0:
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:27:27: fatal error: LiquidCrystal.h: No such file or directory
compilation terminated.

So I tried a simple change to m2ghlc.h

Code:
//#include <LiquidCrystal.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

But more errors appear...

Quote
In file included from HelloWorld_for_m2tklib.cpp:29:0:
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:31:26: error: variable or field ‘m2_SetLiquidCrystal’ declared void
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:31:26: error: ‘LiquidCrystal’ was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:31:41: error: ‘lc_ptr’ was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:31:57: error: expected primary-expression before ‘cols’
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghlc.h:31:71: error: expected primary-expression before ‘rows’
HelloWorld_for_m2tklib.cpp: In function ‘void setup()’:
HelloWorld_for_m2tklib.cpp:40:34: error: ‘m2_SetLiquidCrystal’ was not declared in this scope

So I thought I had better ask before making matters worse smiley

29  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 05:12:10 pm
OK I re-read your OP and you shouldn't have made the changes. Now change them back and post the ORIGINAL error messages. the prog_char and char are the same sizes (1-byte) but the similarity ends there.

I changed them because I found a forum post that said prog_char was deprecated, and a bug report was around to get it's handling fixed.  However, as you requested

Code:
phi_prompt_example_menu_20X4_display_phi_panel.cpp:63:9: error: ‘prog_char’ does not name a type
phi_prompt_example_menu_20X4_display_phi_panel.cpp: In function ‘void show_credit()’:
phi_prompt_example_menu_20X4_display_phi_panel.cpp:96:23: error: ‘msg_00’ was not declared in this scope
phi_prompt_example_menu_20X4_display_phi_panel.cpp: At global scope:
phi_prompt_example_menu_20X4_display_phi_panel.cpp:136:9: error: ‘prog_char’ does not name a type
phi_prompt_example_menu_20X4_display_phi_panel.cpp:137:9: error: ‘prog_char’ does not name a type
30  Using Arduino / Programming Questions / Re: Phi Prompt menu examples will not compile on: February 06, 2013, 05:05:33 pm
Post the first few lines of the error message. "Nothing will compile" could mean a billion different problems.

An example error is in my first post.
Pages: 1 [2] 3 4