Show Posts
Pages: 1 [2] 3 4 ... 9
16  Using Arduino / Displays / Re: Looking for a bright 2.2" display on: June 16, 2014, 05:14:40 pm
An the last two sheets

17  Using Arduino / Displays / Re: Looking for a bright 2.2" display on: June 16, 2014, 05:13:38 pm
Yes, thats what I thought :-/.

I just found an 2.4" OLED color display with 320x240
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=181297639621&ssPageName=ADME:L:OC:DE:3160

The good thing is that Im already using 320x240, so I don't need to rescale my GUI smiley-grin.

Does anyone know if there is a sketch/driver for that?

18  Using Arduino / Displays / Looking for a bright 2.2" display on: June 15, 2014, 05:09:21 am
Hi!

Im looking for a bright 2.2" color graphics Display. I was using the Adafruit 2.2" which is good but not readable in direct sunlight.
http://www.adafruit.com/products/1480

I was already looking for an OLED but it looks like they're not available in 2.2", at least not in this particular rectangle shape.

It would be a dream if it would have a resolution of 240x320...
Are there any available?
19  International / Deutsch / Re: Array einer funktion zurückgeben on: June 11, 2014, 06:50:10 am
Danke Ralf und jurs, so werde ich es wohl machen.

Habe gerade anscheinend noch Probleme mit meiner Syntax, könnte das eventuell jemand korrigieren?

Code:
int *getTime() {
  Wire.begin();
 uint8_t myDate[6] = {0, 0, 0, 0, 0, 0}; //seconds,minutes,hours,date,month,year (last 2 digits)

  // send request to receive data starting at register 0
  Wire.beginTransmission(0x68); // 0x68 is DS3231 device address
  Wire.write(0);                // start at register 0
  Wire.endTransmission();
  Wire.requestFrom(0x68, 7);    // request 7 bytes (seconds, minutes, hours, day, date, month, year)
  while (Wire.available())
  {
    for (int i = 0; i <= 6; i++) {
      if (i == 3) {
        int throwAway = bcdToDec(Wire.read()); //we dont care about the dayOfWeek
      }
      else {
       myDate[i] = (bcdToDec(Wire.read());
      }
    }
  }
  return (myDate[]);
}

Ich bekomme noch folgenden Fehler
Code:
MUO_2_2inch.ino: In function 'int* getTime()':
MUO_2_2inch:254: error: expected primary-expression before ']' token


20  International / Deutsch / Re: Array einer funktion zurückgeben on: June 11, 2014, 03:03:09 am
Aber die funktion DateGenerator() generiert mir ja das Array das es vorher nicht gibt. Zwar kann ich es im loop definieren jedoch kann die funktion dann nicht darauf zugreifen und schreiben, oder sehen ich das falsch?

Mein Ziel ist es ja das von DateGenerator() generierte Array an die Funktion displayTime() zu übergeben....

Soweit ich also verstanden habe geht es nicht. Schade, also muss ich alle meine Arrays global definieren, ich dachte ich könnte meinen Code etwas übersichtlicher gestalten und so die unnötigen Array definitionen weglassen.

Grüße
21  International / Deutsch / Array einer funktion zurückgeben on: June 10, 2014, 04:13:00 pm
Hallo,

Ich möchte ein Array aus einer Funktion an eine andere funktion übergeben ohne das ich diese global definieren muss, geht das?

Quasi in etwa so

Code:
void loop() {
  // put your main code here, to run repeatedly:
displayTime(DateGenerator());
}
int* DateGenerator(){
  int MyArray[]= {0,0,0,};
  return MyArray[];
  }
void displayTime(int DateArray[]){
 //do something with DataArray
  }

Wie mache ich das richtig?
22  Using Arduino / Networking, Protocols, and Devices / Re: Problem with ArdOSCForWiFlyHQ on: June 10, 2014, 01:48:04 pm
So,

I got it finally working (kind of)! Im receiving messages and can send messages to Touchosc using the wifly.

But the thing is, im Receiving messages like this:

Code:
/field1/rotary1 ,f BEï�
/field1/rotary1 ,f A
/field1/rotary1 ,f Bwb2
/field1/rotary1 ,f B™Z
/field1/rotary1 ,f B«.I
/field1/rotary1 ,f B¶
/field1/rotary1 ,f B\Û9
/field1/rotary1 ,f BÆ£
/field1/rotary1 ,f AÓöˆ
/field1/rotary1 ,f AK¹Ñ

Im using Serial.write( Serial1.read() ); to read the data from the wifly, does anyone know what I'm doing wrong? Do I have to convert the value?

Also, when I hold the button in TouchOSC the message is repeatedly sent, after one second of pressing the button this is what I get:

Code:
/field1/rotary1 ,f @Ãï¢/field1/rotary1 ,f @ÂW•/engine/r/fi/fi/fie/fie,/ot/fi/fi 

Is this a buffer overflow?
23  Products / Arduino Due / Due SPI slow (especially for specific pin (DueExtendedSPI)) on: June 10, 2014, 09:35:53 am
Hi,

I was just experimenting with my Adafruit Display which is using an ILI9340 Chip. It was quite slow so I tried to tweak it a little bit. The first thing that came to my mind was to change the clockdiver.

Im using this libary: https://github.com/adafruit/Adafruit_ILI9340

Stock clockdivider is 11 which is 7-6Mhz
Benchmark result:
Code:
Adafruit 2.2" SPI TFT Test!
Benchmark                Time (microseconds)
Screen fill 1913383
Text                     121685
Lines                    1147001
Horiz/Vert Lines         157330
Rectangles (outline)     101025
Rectangles (filled)      3972593
Circles (filled)         610004
Circles (outline)        500776
Triangles (outline)      363771
Triangles (filled)       1314108
Rounded rects (outline)  221244
Rounded rects (filled)   4345116
Done!


I changed it to 9
Benchmark results. Clockdivider = 9
Code:
Adafruit 2.2" SPI TFT Test!
Benchmark                Time (microseconds)
Screen fill 1803141
Text                     116696
Lines                    1100386
Horiz/Vert Lines         147317
Rectangles (outline)     94720
Rectangles (filled)      3743585
Circles (filled)         579950
Circles (outline)        480619
Triangles (outline)      348937
Triangles (filled)       1227087
Rounded rects (outline)  210705
Rounded rects (filled)   4093446
Done!


Which was a little bit better... Now, I just wanted to know the limit of the Display (or what happens when the signal is to fast). So I changed it to 2
Benchmark results. Clockdivider = 2
Code:
Adafruit 2.2" SPI TFT Test!
Benchmark                Time (microseconds)
Screen fill              1290915
Text                     92619
Lines                    872079
Horiz/Vert Lines         105513
Rectangles (outline)     68141
Rectangles (filled)      2680671
Circles (filled)         434087
Circles (outline)        380752
Triangles (outline)      276503
Triangles (filled)       882989
Rounded rects (outline)  162050
Rounded rects (filled)   2938015
Done!

Hm, I was puzzled... The screen is very fast and even the lines and small letters were without any fault. I thought there would be some kind of dead pixels or something, but nothing. The Display is cripy as always..
It was even working with a clockdivider of 1, so at full speed 84Mhz!

After this I tried the new "Sam feature", adding the SPI Pin for this mode and it made it terrible slow

Benchmark results. SPI.setClockDivider(2,_cs)
Code:
Benchmark                Time (microseconds)
Screen fill              1876418
Text                     120145
Lines                    1132974
Horiz/Vert Lines         153278
Rectangles (outline)     98503
Rectangles (filled)      3896083
Circles (filled)         600755
Circles (outline)        494876
Triangles (outline)      359256
Triangles (filled)       1276280
Rounded rects (outline)  217630
Rounded rects (filled)   4259117
Done!


Can anyone explain what is happening? Is the display really running at 42Mhz? And why is the new function slowing it down so much? I'd really like to use the SPI mode for specific Pins, but not when it is that slow. I think then it will be faster to write your own output specific Clockdivider function.

-tsaG
24  Using Arduino / Networking, Protocols, and Devices / Re: Problem with ArdOSCForWiFlyHQ on: June 06, 2014, 06:25:27 am
So, no one?

I thought this could be a simple fault in using some kind of function wrong :-/
25  Products / Arduino Due / Reset Button not working. on: June 05, 2014, 05:27:55 pm
Hi!

I have a problem with my due. The reset button is not working. I tried to test it using a simple Serial write sketch...
Does anyone know why or how to fix this?
I noticed this as I was testing my Displayshield. Somehow it only showed something as I flashed the sketch to the Chip, after connecting/disconnecting the Arduino it was just showing a white screen.

Code:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
  Serial.begin(115200);
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
  Serial.println("reboot succesfull!");
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
Serial.println("not rebooting :(");
}
26  Using Arduino / Networking, Protocols, and Devices / Problem with ArdOSCForWiFlyHQ on: June 04, 2014, 05:15:16 pm
Hi,

I just downloaded ArdOSCForWiFlyHQ and WiflyHQ and wanted to build the SimpleReceive example but I get the following error, Im using an Arduino Due:

Code:
C:\...\WiFlyHQ.cpp: In member function 'int8_t WiFly::getDHCPMode()':
C:\...\WiFlyHQ.cpp:1515: error: 'strncmp_P' was not declared in this scope
C:\...\WiFlyHQ.cpp: In member function 'boolean WiFly::getres(char*, int)':
C:\...\WiFlyHQ.cpp:1611: error: 'strncpy_P' was not declared in this scope

Here is the Sketch (which I just downloaded):
Code:
// How to send OSC messages from an Arduino.
// This Example is in the public domain.

// Important known issues:
// The Wifly provides no means to get the data from a single UDP package at a time
// Everything is just dumped to the serial connection.
// The only hint that a package is finished is that reading from the serial *might* time out
// To make things work anyway:
// 1. Use a high baud rate for communication with the Wifly: 115200 on a hardware serial is perfect.
// 2. Adjust the timeout in server.availableCheck(). 2ms works fine with 115200baud.
// 3. If possible, let the controlling Program pause at least 1.5 times the timout between sending OSC messages.

#include <WiFlyHQ.h>
#include <ArdOSCForWiFlyHQ.h>

//uncomment this to use a software serial if you dont own a MEGA
//#include <SoftwareSerial.h>
//SoftwareSerial softSerial(softSerialRx,softSerialTx);

WiFly wifly;
OSCServer server(&wifly);

int ledPin=13;

void setup()
{
  Serial.begin(115200);
  //use the convenient setup. Replace <HardwareSerial> by <SoftwareSerial> if you use one.
  wifly.setupForUDP<HardwareSerial>(
    &Serial1,   //the serial you want to use (this can also be a software serial)
    9600, // if you use a hardware serial, I would recommend the full 115200. This does not work with a software serial.
    true, // should we try some other baudrates if the currently selected one fails?
    "WLAN-466B23",  //Your Wifi Name (SSID)
    "SP-213B33501", //Your Wifi Password
    "WiFly",                 // Device name for identification in the network
    "192.168.2.201",         // IP Adress of the Wifly. if 0 (without quotes), it will use dhcp to get an ip
    8000,                    // WiFly receive port
    "255.255.255.255",       // Where to send outgoing Osc messages. "255.255.255.255" will send to all hosts in the subnet
    8001,                     // outgoing port
    true // show debug information on Serial
  );
  wifly.printStatusInfo(); //print some debug information

  pinMode(ledPin,OUTPUT); //prepare to fade th einternal LED by OSC
   // Register a callback fuction of the LED fading.
   // When a message is with the adress "/ard/ledFade" is received, "setLedFade" will be invoked.
   server.addCallback("/ard/ledFade",&setLedFade);
}


void loop()
{
//check for new incoming messages. If a message with a registered adress is recieved, the callback function will be invoked.
  if(server.availableCheck(2)>0)
  {  
    //debugoutln("alive!"); //callback after process
  }
}

void setLedFade(OSCMessage *_mes){
  //get 1st argument(int32) and use it to fade the LED
  int fadeValue=_mes->getArgInt32(0);
  Serial.println(fadeValue);
  analogWrite(ledPin,fadeValue );
}

Link for the libraries:
https://github.com/Zapalot

-tsaG

27  Using Arduino / Networking, Protocols, and Devices / Re: Getting the Wifly to work on the DUE on: June 02, 2014, 06:10:26 am
Okay! I got it working using the WiflyWebTimeServer sketch. I reseted the arduino, opened the Serial Monitor and plugged in the Wifly just in the right moment and it worked. I tried it 12345 times and finally it worked smiley-grin

Next step is to establish an UDP connection to another device. I think I'll use my Macbook and Processing for this...
28  Using Arduino / Networking, Protocols, and Devices / Getting the Wifly to work on the DUE on: June 02, 2014, 05:43:26 am
Hi,
Im using the Rover Wifly Board with my DUE. Im using the WiflySerial1 library. I compiled and ran the WiflyWebTimeServer sample. Okay, since I didnt configure the Wifly it wouldnt work.. So I compiled the wiflySerial1Test project and tried to get into the CMD Mode, but somehow it wont let me configure the Wifly smiley-sad thats what I have in the console:


Code:
-- Tester for WiFly communication through Serial1 --

Establish communication with WiFly at 9600 bps...
 wifly-EZX Ver 4.00.1, Apr 19 2013 11:47:16 on RN-171
MAC Addr=00:06:66:55:5c:92
*READY*
Auto-Assoc Abcdefgh chan=0 mode=NONE FAILED
Auto-Assoc Abcdefgh chan=0 mode=NONE FAILED
Auto-Assoc Abcdefgh chan=0 mode=NONE FAILED
Auto-Assoc Abcdefgh chan=0 mode=NONE FAILED
Auto-Assoc Abcdefgh chan=0 mode=NONE FAILED
......

and here is the code:
Code:
/*******************************************************************************
**                                                                            **
**  A simple sketch for testing communication between WiFly Rn-131C           **
**  and Arduino Mega 2560 or Arduino Due on port Serial1 at 9600 bauds        **
**                                                                            **
**      Arduino          WiFly                                                **
**        GND  ---------  GND                                                 **
**        3V3  -------- 3.3V-RIN                                              **
**      RX1 (19) -------  TX                                                  **
**      TX1 (18) -------  RX                                                  **
**                                                                            **
**  LPGL 2.0                                                                  **
**  Jean-Michel Gallego                                                       **
**                                                                            **
*******************************************************************************/

#include <Arduino.h>

void setup()
{
  // initialise serial interface 0 connected to console
  Serial.begin( 9600 );
  Serial.println( " -- Tester for WiFly communication through Serial1 --" );
  Serial.println();
  Serial.println( "Establish communication with WiFly at 9600 bps..." );

  Serial1.begin( 9600 );
  delay( 1000 );
  Serial1.print( "$$$" );
  delay( 300 );
 // Serial1.print( "\rver\r" );
}

/*******************************************************************************
**                                                                            **
**                                 LOOP ROUTINE                               **
**                                                                            **
*******************************************************************************/

char ch;

void loop()
{
  while( Serial1.available() )
    Serial.write( Serial1.read() );

  if( Serial.available() )
  {
    ch = Serial.read();
    Serial1.write( ch );
  }
}
29  Using Arduino / Networking, Protocols, and Devices / Wifly Iphone and Protocol (OSC ?) on: May 29, 2014, 04:46:55 pm
Hi,

I just received my WiFly module and was looking for the best way to start.

My project is to send data ( approx. 10x4byte) to two iOS devices at minimum 500ms intervals.

I already programed my iOS and the Arduino App to collect the data from the sensors, the "only" thing I need is to connect those devices smiley-grin

Data should be primary read from the Arduino, sometimes the Arduino should receive data as well (settings or something)...

I was thinking about the OSC protocol which I was using for Mac -> iOS devices before.

Is there a library for that?  smiley-grin Or are there better/easier ways? Im pretty new to those wifi network Communication stuff.

 Im using the "RN-XV WiFly Module - Wire Antenna" and the Arduino Due


-tsaG
30  Using Arduino / Programming Questions / Re: Programming AVR Arduino with Arduino Due on: May 24, 2014, 08:03:46 am
Hm, not possible? Well at least there isn't anyone who did it before?
Pages: 1 [2] 3 4 ... 9