Show Posts
Pages: [1] 2 3 ... 14
1  Development / Other Hardware Development / Re: I2C port expanders PCF8575C vs. MCP23017 on: September 28, 2014, 06:47:29 pm
The 23017 etc are very common and I'm sure there are libraries to drive them, not sure that is the case with the 8575.

______
Rob

There is a library for the 8575 at Sparkfun.  Jim
2  Using Arduino / Programming Questions / Re: program error on write to lcd on: September 19, 2014, 11:43:05 am
I been away on business, just got back, and started trying your code.
Current code

Code:
#include "LCD12864RSPI.h"
#include "DFrobot_bmp.h"
#include "DFrobot_char.h"

#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
unsigned char tT[]="ST7920 LCD12864 ";//

void setup()
{
  LCDA.initDriverPin(2,7,10);
  LCDA.Initialise(); // INIT SCREEN 
  delay(100);
  LCDA.DrawFullScreen(logo);//LOGO
  delay(5000);
  Serial.begin(9600);
}

void loop()
{
   char msg[20];                     
  int charsRead;
  LCDA.CLEAR();
  delay(100);
  if (Serial.available() > 0)   {
      charsRead = Serial.readBytesUntil('\n', msg, 19);  // we need room for the null character for strings
      msg[charsRead] = '\n';
//      LCDA.DisplayString(0,0,msg,16);
      LCDA.DisplayString(1,0,tT,16);
  delay(500);
}
delay(5000);
}

Code as displayed does compile,and run correctly. Commented code does not compile. Error is

Quote
lcdtest.ino: In function 'void loop()':
lcdtest:28: error: invalid conversion from 'char*' to 'unsigned char*'
lcdtest:28: error: initializing argument 3 of 'void LCD12864RSPI::DisplayString(int, int, unsigned char*, int)'

I am afraid I just don't groc it when pointers are involved. I was a hardware person involved in very large power supplies(150 KV300A) before I retired.

Jim
3  Community / Bar Sport / Re: Who hasn't accidentally touched a mains voltage once or twice? on: September 17, 2014, 07:48:35 pm
Worse than mains, in 1959 I worked for a company that made hv supplys for backward wave oscillators and traveling wave tube  amplifiers.I was working on a 5kv 2a power supply with the supply supposedly interlocked off. The interlock didn't work and  several times I leaned forward and got a tingle. The third time I knew  something was wrong, the high voltage was on. I was just getting a tingle through my corduroy pants, thank god for thick  pants! Jim
4  Using Arduino / Programming Questions / Re: program error on write to lcd on: September 15, 2014, 01:19:09 pm
I don't have your libraries, but I can see several problems:

   1. using the String class is usually unnecessary. Better off with a char array.
   2. You never define the LCDA object, which means you can't call the CLEAR() method. Does
        LCD12864RSPI.h mean it is a Raspberry Pi library?
   3. Why the call to delay(100)?
   4. Since you're looking for the newline character ('\n'), use readBytesUntil() method. charsRead tells you how many
      characters were sent.


1 you are probably totally right
2 yes
3 it was in the sample code. I thought it might be for a reason, so I left it in.
4 right
I will try you sample.
Jim
5  Using Arduino / Programming Questions / program error on write to lcd on: September 14, 2014, 08:37:28 pm
I am trying to display what comes in on serial. My code
Code:
#include "LCD12864RSPI.h"
#include "DFrobot_bmp.h"
#include "DFrobot_char.h"

#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
void setup()
{
  LCDA.initDriverPin(8,9,10);
  LCDA.Initialise(); // INIT SCREEN 
  delay(100);
}
void loop()
{
  String msg;
  LCDA.CLEAR();//����
  delay(100);
  if (Serial.available() > 0)
  {
    while (Serial.available() > 0)
    {
      msg += char(Serial.read());
      if (msg = "/n")
       {
         LCDA.DisplayString(0,0,msg,16);
         break;
       }
    } 
  } 
  delay(500);
}
and error
Quote
LCD12864_test.ino: In function 'void loop()':
LCD12864_test:24: error: no matching function for call to 'LCD12864RSPI::DisplayString(int, int, String&, int)'
C:\Users\Jim\Documents\Arduino\libraries\LCD12864RSPI/LCD12864RSPI.h:29: note: candidates are: void LCD12864RSPI::DisplayString(int, int, unsigned char*, int)
I always have trouble with char arrays-strings
Jim
6  Using Arduino / Programming Questions / Re: Sketch compiles on PC but not on Raspberry Pi on: September 07, 2014, 12:15:50 pm
tf68 said, Do the obvious, fix the source code.

Not exactly obvious to this beginner. Certainly not obvious from the error messages. BUT, it did the trick!! Thank you! Thank you! Thank you!!!
Jim
7  Development / Suggestions for the Arduino Project / Update libraries button or meni item on: September 04, 2014, 01:26:55 pm
I working with a Arduino and a raspberry pi and it is a real drag having to close arduino and restart every time you load a new library. The pi takes about 30 seconds to load every time and it then you have to reload your sketch. It would be so much easier to just reload the libraries without exiting and re-loading arduino!

Jim
8  Using Arduino / Programming Questions / Sketch compiles on PC but not on Raspberry Pi on: September 04, 2014, 12:56:11 pm
O have this Sketch


Code:
String inputString = "";         // a string to hold incoming data
boolean stringComplete = false;  // whether the string is complete
int ledpin = 13;
#include <Time.h> 
#include <Wire.h> 
#include <DS1307RTC.h>  // a basic DS1307 library that returns time as a time_t

 
void setup()
{
// initialize serial:
  Serial.begin(9600);
// reserve 200 bytes for the inputString:
  inputString.reserve(200);
  while (!Serial) ; // wait until Arduino Serial Monitor opens
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if(timeStatus()!= timeSet)
     Serial.println("Unable to sync with the RTC");
  else
     Serial.println("RTC has set the system time");     
}

void loop()
{
// print the string when a newline arrives and turn led on/off
  if (stringComplete)
  {
    Serial.println(inputString);
    if(inputString == "1")
    {
      Serial.print(inputString);
      if (timeStatus() == timeSet)
      {
        digitalClockDisplay();
      }
      else
      {
        Serial.println("The time has not been set.  Please run the Time");
        Serial.println("TimeRTCSet example, or DS1307RTC SetTime example.");
        Serial.println();
        delay(4000);
      }
      delay(1000);
    }
    else if(inputString == "two")
    {
      digitalWrite(ledpin,LOW);
    }
    inputString = "";
    stringComplete = false;
  }
}
void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year());
  Serial.println();
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

/*
  SerialEvent occurs whenever a new data comes in the
 hardware serial RX.  This routine is run between each
 time loop() runs, so using delay inside loop can delay
 response.  Multiple bytes of data may be available.
 */
void serialEvent()
{
  while (Serial.available())
  {
// get the new byte:
    char inChar = (char)Serial.read();
//    Serial.print(inChar);    // add it to the inputString:
    if (inChar == '\n')
    {
      stringComplete = true;
    }
    else
    {
    inputString += inChar;
    }
  }
}

It compiles without error on my win7-64 bit pc, but fail when I attempt to compile on my Raspberry Pi. The error is
Quote

/usr/share/arduino/libraries/Time/DateStrings.cpp:41:22: error: variable ‘monthNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/usr/share/arduino/libraries/Time/DateStrings.cpp:58:20: error: variable ‘dayNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
/usr/share/arduino/libraries/Time/DateStrings.cpp:59:24: error: variable ‘dayShortNames_P’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

Any ideas?
Jim
9  Using Arduino / Displays / Re: Unknown LCD on: September 03, 2014, 11:27:05 am

You might remove the add-on board, it might be easier to use the pins directly.

Unfortunately I lost the use of my right arm. Removing the board is beyond my one handed capabilities.
Jim
PS I knew it was a 12864.
10  Using Arduino / Displays / Unknown LCD on: September 02, 2014, 08:58:13 pm
Afriend of mine recently passed away. Since he was also an Arduino enthusiast,and had some miscellaneous stuff, his family gave it to me. I trying to get this LCD working but don't have the software.It is in two pieces that go together, a Sensor shield and the LCD.
Pictures to identify
back of LCD www.hodgers-house.com/backside
how they are connected, appears to be d3,d4,d5  www.hodgers-house.com/connection.jpg
Jim
11  Using Arduino / Programming Questions / Re: Compile error with no message on: August 01, 2014, 02:01:21 pm
Thanks econjack, that did the trick!
Jim
12  Using Arduino / Programming Questions / Compile error with no message on: August 01, 2014, 12:36:26 pm
I have written the following
Code:
// read serial and repeat to serial with added string


void setup()
{
  Serial.begin(115200);
}

void loop()
{
 string message[30];
 string saluation[7];
 string fullString[40];
 int lf = 10;
 if (Serial.available() > 0)
  {
    Serial.readBytesUntil(lf, message, 30);
    saluation = 'I got ';
    fullString = saluation + message;
    Serial.println(fullString);
    delay(1000);
  }
}
When I try to compile, the orange bar says "error compiling", and there is no explanation below.
I know the way I'm doing this is kludgie, but I'm still new to C or C+.
Jim
13  Community / Local Groups / Re: Anyone in Denver or Colorado? on: July 14, 2014, 07:49:04 pm
I'm in Buena Vista. I just a advancing newbie. I sure wist there was a group here!

Jim
14  Using Arduino / Installation & Troubleshooting / Question about loading Atmel Sudio for Arduino on: April 02, 2014, 02:32:29 pm
I'm following the instructions at http://www.engblaze.com/tutorial-using-atmel-studio-6-with-arduino-projects/. I get to the step where you load the <project_name>.cpp file(Step 6). I compiled the "Blink" example. There is a "Blink.cpp.d" file, a "Blink.cpp.eep" file, a Blink.cpp elf" file, a "Blink.cpp.hex" file, and a "Blink.cpp.o" file, but no "Blink.cpp" file, or even a "<name>.cpp". There are several other files with a "cpp.d" or "cpp.o" extension. Which is the one I want to copy?

Jim
15  Community / Products and Services / Re: Amazing Sale...Arduino's for $3!!! on: April 01, 2014, 07:37:50 pm
You had to register to get the deal. My email is so slow that the time limit was over befote I could register. Oh well,Boo Hoo
Jim
Pages: [1] 2 3 ... 14