Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / Re: Read serial input startswith on: December 13, 2012, 10:51:22 am
I understand but i took the text startswith from one site
some serial code from another and some pieces of an example and some from arduino pages.
but the code is no at all one a site i made it myself
so i dont think the site makes any sense...

but like all ways most people speak here about the mistakes you make in the posting and not about the mistakes you make in the code

i go on trying examples and find it out myself
2  Using Arduino / Programming Questions / Re: Read serial input startswith on: December 13, 2012, 08:30:39 am
@ Awol
from different sites...

error is
sketch_dec13a:16: error: request for member 'startsWith' in 'incomingByte', which is of non-class type 'char'

@GoForSmoke ( haha i had smoke yesterday when connecting it wrong )

ok so i need to read the whole string or what is the correct name for it..?
but how do i get he whole message?
back to google again...
3  Using Arduino / Programming Questions / Read serial input startswith on: December 13, 2012, 08:12:18 am
Hello,

I created the following code by copy pasting...
But i get an error message and i cannot find out why or how...

This is the code
Code:
//serial input

char incomingByte;
char FileName;

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

void loop() {
  // see if there's incoming serial data:
  if (Serial.available() > 0) {
    // read the oldest byte in the serial buffer:
    incomingByte = Serial.read();
    // if it starts with IMG then set it as FileName
    if (incomingByte.startsWith("IMG")) {
      Serial.println("File Read");
      FileName=incomingByte;
    }
  }
 
 
  delay(1000);
}

I want if the serial string starts with IMG that FileName is set to the serial input.
4  Using Arduino / Networking, Protocols, and Devices / Mega + ard wifi shield + usb host shield on: December 02, 2012, 05:51:45 am
Hi,

I have an Mega with a arduino wifi shield and an usb host shield from circuits@home on top.
Pin 10 is changed to pin 8 for the SPI

I want to do something now with wifi
But when i take a basic example for wifi like this
Code:
#include <WiFi.h>

char ssid[] = "yourNetwork";     //  your network SSID (name)
char pass[] = "12345678";    // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

void setup() {
  // initialize serial:
  Serial.begin(9600);

  // attempt to connect using WPA2 encryption:
  Serial.println("Attempting to connect to WPA network...");
  status = WiFi.begin(ssid, pass);

  // if you're not connected, stop here:
  if ( status != WL_CONNECTED) {
    Serial.println("Couldn't get a wifi connection");
    while(true);
  }
  // if you are connected, print out info about the connection:
  else {
    Serial.println("Connected to network");
  }
}

void loop() {
  // do nothing
}

Then it is only running when i remove the usb shield.
When i attache the usb shield again it sometime scan the wifi networks
But most times it give errors.

I checked all the data connection and there is no double used pin or something like that.

Anyone any idea?
Thanks!
5  Topics / Device Hacking / Re: Serial use of Bluetooth GPS devices? on: September 22, 2012, 10:58:52 am
hi,

i have a plan to send data to my camera from the arduino
but do i understand it good that the signal from a bluetooth device is a serial signal?
so i can send this code from my arduino to my camera?

or do i make a mistake in my conclusion?

Thanks!  smiley-grin
6  Using Arduino / Programming Questions / Re: How is this function called? on: September 19, 2012, 04:19:42 pm
O and a if i put this on on tab and inlcude this then, is that "good" programming to keep it clear?
7  Using Arduino / Programming Questions / Re: How is this function called? on: September 19, 2012, 04:17:48 pm
Thanks too all!!!
8  Using Arduino / Programming Questions / How is this function called? on: September 19, 2012, 04:05:39 pm
Hello,

i am looking for a way to set multiple outputs in one line
i have now this line that is repeating
Code:
     
digitalWrite(whitePin, HIGH);
digitalWrite(greenPin, HIGH);
lcd.print("message");

but i want to do something like this
Code:

set This
{
digitalWrite(whitePin, HIGH);
digitalWrite(greenPin, HIGH);
lcd.print("message");
}

do.This

but first of all, how is this called?? ( so i can find more info about it on google )
9  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 15, 2012, 10:51:11 am
The code is all the code that van be found on the web
and it is a huge zip with files and i didnt know were to begin.

but...

with thanks to Oleg i finally found the problem...
and the problem was that i did not install the usb library  smiley-kiss smiley-kiss smiley-kiss

so now it is working and it did not has to do nothing with the ptp.h
it even works on IDE1.0

but thanks anyway!
10  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 15, 2012, 09:22:31 am
Quote
But, you're not going to tell us what the problems are, or what version of the IDE you are getting them on.
I wish i found out what the problem is
for now i only know that the errors show up when i include this one

Quote
I'm sure it would be. Whack yourself with a clue-by-four first, though...
Sorry i do not understand what you mean with this, but i conclude that you are not going to help and i need to do it my self...
11  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 15, 2012, 06:51:32 am
I found out that the problems come from ptp.h
When i uncomment all it goes wrong with this one...

hope to find out now...
help is still welcome!
12  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 15, 2012, 12:57:25 am
With the 0.23 build it is giving errors too.

Can somebody confirm that it should be working?
Or has somebody been able to compile without errors?
13  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 14, 2012, 05:45:48 pm
Ok thanks...

i am going to search now for older IDE

14  Using Arduino / Programming Questions / Re: Working usb shield canon eos example on: September 14, 2012, 05:29:36 pm
Hi ,

Thanks for your suggestion
But if it was this simple i should have found it all ready after some days...
Unfortunatly it is not the solution

but thanks again...

For example the code i want to try to use is this one
Code:
#include <inttypes.h>
#include <avr/pgmspace.h>

//#include <Spi.h>
#include <Max3421e.h>
#include <Max3421e_constants.h>
#include <Max_LCD.h>
#include <Usb.h>

#include <ptp.h>
#include <ptpdebug.h>
#include <canoneos.h>
#include <simpletimer.h>

#define DEV_ADDR        1

// Canon EOS 400D
#define DATA_IN_EP      1
#define DATA_OUT_EP     2
#define INTERRUPT_EP    3
#define CONFIG_NUM      1

class CamStateHandlers : public EOSStateHandlers
{
      enum CamStates { stInitial, stDisconnected, stConnected };
      CamStates stateConnected;
   
public:
      CamStateHandlers() : stateConnected(stInitial)
      {
      };
     
      virtual void OnDeviceDisconnectedState(PTP *ptp);
      virtual void OnDeviceInitializedState(PTP *ptp);
};

CamStateHandlers   CamStates;
SimpleTimer        PTPPollTimer;
CanonEOS           Eos(DEV_ADDR, DATA_IN_EP, DATA_OUT_EP, INTERRUPT_EP, CONFIG_NUM, &CamStates);


void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
{
    if (stateConnected == stConnected || stateConnected == stInitial)
    {
        stateConnected = stDisconnected;
        PTPPollTimer.Disable();
        Notify(PSTR("\r\nDevice disconnected.\r\n"));
    }
}

void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
{
    if (stateConnected == stDisconnected)
    {
        stateConnected = stConnected;
        PTPPollTimer.Enable();
    }
}

void OnPTPPollTimer()
{
    Serial.println("\r\n");
   
    HexDump  hex;
    Eos.EventCheck(&hex);
}

void setup()
{
    Serial.begin( 115200 );
    Serial.println("Start");
    Eos.Setup();
    delay( 200 );
    PTPPollTimer.Set(OnPTPPollTimer, 1000);
}

void loop()
{
    Eos.Task();
    PTPPollTimer.Run();
}
15  Using Arduino / Programming Questions / Working usb shield canon eos example on: September 14, 2012, 05:15:02 pm
hello,

i am looking for some help with my usb shield.
I found some great examples on https://github.com/felis/Arduino_Camera_Control
But none of them i can get to work.
I think do something wrong...
I dowloaded the zip and placed it in my arduino folder
The examples show up in the program but when i try to compile them the errors are great!
I will post some errors below...
And the only thing that i would like to do is read the filename for the camera
So if someone can help me with that i pay his beer and the next one too ;-)

The errors...
Code:


In file included from /Users/user/Documents/Arduino/libraries/Camera/ptp.h:28,
                 from EOSEventMonitor.cpp:10:
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h:22:22: error: WProgram.h: No such file or directory
In file included from /Users/user/Documents/Arduino/libraries/Camera/ptp.h:28,
                 from EOSEventMonitor.cpp:10:
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h: In constructor 'MultiByteValueParser::MultiByteValueParser()':
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h:44: error: 'NULL' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h: In constructor 'ByteSkipper::ByteSkipper()':
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h:64: error: 'NULL' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h: At global scope:
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h:147: error: 'NULL' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h: In constructor 'PTPListParser::PTPListParser()':
/Users/user/Documents/Arduino/libraries/Camera/ptpcallback.h:116: error: 'NULL' was not declared in this scope
In file included from /Users/user/Documents/Arduino/libraries/Camera/ptp.h:29,
                 from EOSEventMonitor.cpp:10:
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h: In function 'void PrintHex(T)':
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:35: error: 'Serial' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:39: error: 'Serial' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:39: error: 'HEX' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h: At global scope:
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:43: error: variable or field 'PrintHex2' declared void
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:43: error: 'Print' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:43: error: 'prn' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptpdebug.h:43: error: expected primary-expression before 'val'
In file included from EOSEventMonitor.cpp:10:
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:77: error: 'MAX3421E' does not name a type
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:78: error: 'USB' does not name a type
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:86: error: 'EP_RECORD' does not name a type
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:116: error: ISO C++ forbids declaration of 'MAX3421E' with no type
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:116: error: expected ';' before '*' token
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:117: error: ISO C++ forbids declaration of 'USB' with no type
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:117: error: expected ';' before '*' token
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:171: error: 'byte' has not been declared
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:171: error: 'byte' has not been declared
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:128: error: 'NULL' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/ptp.h: In member function 'void PTP::Setup()':
/Users/user/Documents/Arduino/libraries/Camera/ptp.h:124: error: 'Max' was not declared in this scope
In file included from EOSEventMonitor.cpp:13:
/Users/user/Documents/Arduino/libraries/Camera/simpletimer.h: In constructor 'SimpleTimer::SimpleTimer()':
/Users/user/Documents/Arduino/libraries/Camera/simpletimer.h:47: error: 'NULL' was not declared in this scope
/Users/user/Documents/Arduino/libraries/Camera/simpletimer.h: In member function 'uint32_t SimpleTimer::TimeLeft()':
/Users/user/Documents/Arduino/libraries/Camera/simpletimer.h:64: error: 'millis' was not declared in this scope
Pages: [1] 2 3 4