Show Posts
Pages: [1] 2 3 ... 12
1  Forum 2005-2010 (read only) / Playground Wiki / Re: Shield Pin Usage Table on: June 24, 2010, 04:02:48 pm
functionality first layout later! smiley-razz
asp is not in my Vocabulary...
2  Forum 2005-2010 (read only) / Playground Wiki / Re: Shield Pin Usage Table on: June 24, 2010, 11:31:32 am
what do you code it in html or php? you could use mysql database with all the shields...
and use php to notify of pin useage.

+ a adding system would be a simple as a few <input> fields

i can try to come up with something and post it on my website.
i really want to have a new webpage project.
maybe go trough with the arduino sketchs/library upload site and add this to.

if it ok with you i'll use your code.
3  Forum 2005-2010 (read only) / Forum / Re: Dutch subforum? on: March 07, 2010, 04:47:51 pm
I would love to make a dutch forum on my own website if it would be used...

But there are so few of us dutch people that can't read and (maybe crappy) write english.
and if all the dutch people here have questions and can't explain there selfs just ask in your best english and try to get me or anny other dutch guy to help... or start your topic with [NL] or something

or even better try to explain it in english and dutch so that if i see it i can correct your error's so that everybody gets it.


and i want to point out that if i don't understand something that was found in the french or anny other country u could just use google tanslate to translate the whole page.
it's not that great in translating story's or explainations but if your keep in mind google translates (almost) everything literally.
Then its acceptable.

I think my english is quite good.
of course i make misstake's but hé i'm a dutch blond girl... smiley-razz

______________{ Dutch }__________________________[size=10]
dus voor de nederlanders laat het me weten als jullie een nederlands forum willen en ik zal er een aan maken op mijn eigen website al zal er denk ik vrij weinig volk komen om ook echt iedereen te helpen.
en als er al mensen komen moeten er natuurlijk ook mensen komen die de antwoorden hebben en niet alleen vragen stellen.[/size]


Greets SaSaa.
4  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: {} Bracket Finder Bug? on: April 12, 2010, 01:53:05 pm
i use notepad++ for writing script then paste them into IDE just because i like notepad++ more clear on the brackets and stuff like that maybe i'll write a plugin to reconize the commands and stuff like that.

ik don't like IDE because of its layout and that is java and sometimes Way to slow.
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Matrix clock RTC on: November 08, 2010, 09:43:52 am

finally got the time to post my clock code
Code:
#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 RTC;

unsigned char RainbowCMD[5];
unsigned char State = 0;  
unsigned long timeout;
long previousMillis = 0;
long interval = 5 * 1000; // elke 20 seconden verrandert de kleur.
int r_time = 1;
int g_time = 1;
int b_time = 1;

void setup()
{
  Wire.begin();
  RTC.begin();
  // RTC.adjust(DateTime(__DATE__, __TIME__)); // Correct time
  delay(5000);
  ShowColor(4,15,0,0); ShowColor(3,0,15,0); ShowColor(2,0,0,15); ShowColor(1,15,15,15);
  delay(5000);
}

void loop(){
  DateTime now = RTC.now();
  char time1 = '0' + now.hour() / 10; if(time1 == '0'){ ShowChar(4,'0',0, 0, 0,0); }
  char time2 = '0' + now.hour() % 10; ShowChar(3,time2, r_time, g_time, b_time,0);
  char time3 = '0' + now.minute() / 10; ShowChar(2,time3, r_time, g_time, b_time,0);
  char time4 = '0' + now.minute() % 10;  ShowChar(1,time4, r_time, g_time, b_time,0);
  delay(500);
  SetPixelXY(2, 0, 2, r_time, g_time, b_time);
  SetPixelXY(2, 0, 5, r_time, g_time, b_time);
  delay(500);
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    if(r_time != 0){
      r_time = 0;
      g_time = 1;
      b_time = 0;
    }else if(g_time != 0){
      r_time = 0;
      g_time = 0;
      b_time = 1;
    } if(b_time != 0){
      r_time = 1;
      g_time = 0;
      b_time = 0;
    }
  }
}

void ShowColor(int Adr, unsigned char R, unsigned char G, unsigned char B) {
  unsigned char shift;
  RainbowCMD[0]='R';
  RainbowCMD[1]=0x03;
  RainbowCMD[2] = B;
  RainbowCMD[3]=((G<<4)|(R));
  SentCMD(Adr);
}

void SetPixelXY(int Adr, unsigned char X, unsigned char Y, unsigned char R, unsigned char G, unsigned char B) {
  unsigned char TranslateX[8]={6,7,4,5,2,3,0,1};
  X = TranslateX[X];
  RainbowCMD[0] = 'R';
  RainbowCMD[1] = 0x04;
  RainbowCMD[2] = R;
  RainbowCMD[3] = ((G<<4)|(B));
  RainbowCMD[4] = ((X<<4)|(Y));
  SentCMD(Adr);
}

void ShowChar(int  Address,unsigned char ASCII,unsigned char red, unsigned char green ,unsigned char blue,unsigned char shift)
{
    RainbowCMD[0]='R';
    RainbowCMD[1]=0x02;
    RainbowCMD[2]=((shift<<4)|(red));
    RainbowCMD[3]=((green<<4)|(blue));
    RainbowCMD[4]=ASCII;
    SentCMD(Address);
}

void SentCMD(int  Add)
{   unsigned char OK=0;
     unsigned char i,temp;
 
    while(!OK)
  {                          
    switch (State)
    {       

    case 0:                          
      Wire.beginTransmission(Add);
      for (i=0;i<5;i++) Wire.send(RainbowCMD[i]);
      Wire.endTransmission();    
      delay(5);  
      State=1;                      
      break;

    case 1:

      Wire.requestFrom(Add,1);  
      if (Wire.available()>0)
        temp=Wire.receive();    
      else {
        temp =0xFF;
        timeout++;
      }

      if ((temp==1)||(temp==2)) State=2;
      else if (temp==0) State=0;

      if (timeout>5000)
      {
        timeout=0;
        State=0;
      }

      delay(5);
      break;

    case 2:
      OK=1;
      State=0;
      break;

    default:
      State=0;
      break;

    }
  }
}
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Matrix clock RTC on: October 27, 2010, 03:11:59 am
It works GREAT ! I really love Open Source smiley-razz

thanks Korman.
I'll post my complete code soon smiley-grin
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Matrix clock RTC on: October 26, 2010, 12:35:12 am
I will try it when I get home in about 9 hours :-P
the digit1 to 4 are just part of my explaination*

8  Forum 2005-2010 (read only) / Syntax & Programs / Re: Matrix clock RTC on: October 25, 2010, 02:16:48 pm
I'm able to output it on my LCD's and the serial monitotr but not on the 4 matrices and it really bugs me.

the real problem is that i don't understand how to write it to the display when the numbers are bigger then 9 because it will then take 2 matrices to show the value

the serial monitoris very simple because its as simple as taken from the official example

Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 RTC;

void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();

  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop () {
    DateTime now = RTC.now();
    
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
    
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
    
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
    
    Serial.println();
    delay(3000);
}

how do i get this "Serial.print(now.day(), DEC);" and split the digits if there are 2 :S so i can put in this

Code:
#include <Wire.h>

unsigned char RainbowCMD[5];
unsigned char State = 0;  
unsigned long timeout;


void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
}

void loop()
{
 ShowChar(4,DIGIT1,0,0,15,0);ShowChar(3,DIGIT2,0,0,15,0);ShowChar(2,DIGIT3,0,0,15,0);ShowChar(1,DIGIT4,0,0,15,0); // time NOT working
  delay(1000);
}





//--------------------------------------------------------------------------
//Name:ShowColor
//function: Send a conmand to Rainbowduino for showing a color
//parameter: Address: rainbowduino IIC address
//                 red,green,blue:  the color RGB    
//----------------------------------------------------------------------------
void ShowColor(int Address,unsigned char red , unsigned char green, unsigned char blue)
{
  RainbowCMD[0]='R';
  RainbowCMD[1]=0x03;
  RainbowCMD[2]=red;
  RainbowCMD[3]=((green<<4)|(blue));

   SentCMD(Address);
}


//--------------------------------------------------------------------------
//Name:ShowImage
//function: Send a conmand to Rainbowduino for showing a picture which was pre-set in Rainbowduino Flash
//parameter: Address: rainbowduino IIC address
//                 number:  the pre-set picture position
//                 shift: the picture  shift bit for display
//----------------------------------------------------------------------------
void ShowImage(int Address, unsigned char number,unsigned char shift)
{
    RainbowCMD[0]='R';
    RainbowCMD[1]=0x01;
    RainbowCMD[2]=(shift<<4);
    RainbowCMD[4]=number;
 
     SentCMD(Address);
}



//--------------------------------------------------------------------------
//Name:ShowColor
//function: Send a conmand to Rainbowduino for showing a color
//parameter: Address: rainbowduino IIC address
//                 red,green,blue:  the color RGB  
//                 shift: the picture  shift bit for display
//                 ASCII:the char or Number want to show
//----------------------------------------------------------------------------
void ShowChar(int  Address,unsigned char ASCII,unsigned char red, unsigned char blue ,unsigned char green,unsigned char shift)
{
    RainbowCMD[0]='R';
    RainbowCMD[1]=0x02;
    RainbowCMD[2]=((shift<<4)|(red));
    RainbowCMD[3]=((green<<4)|(blue));
    RainbowCMD[4]=ASCII;
      
     SentCMD(Address);
}




//--------------------------------------------------------------------------
//Name:SentCMD
//function: Send a 5 byet Rainbow conmand out
//parameter: NC  
//----------------------------------------------------------------------------
void SentCMD(int  Add)
{   unsigned char OK=0;
     unsigned char i,temp;
 
    while(!OK)
  {                          
    switch (State)
    {       

    case 0:                          
      Wire.beginTransmission(Add);
      for (i=0;i<5;i++) Wire.send(RainbowCMD[i]);
      Wire.endTransmission();    
      delay(5);  
      State=1;                      
      break;

    case 1:

      Wire.requestFrom(Add,1);  
      if (Wire.available()>0)
        temp=Wire.receive();    
      else {
        temp =0xFF;
        timeout++;
      }

      if ((temp==1)||(temp==2)) State=2;
      else if (temp==0) State=0;

      if (timeout>5000)
      {
        timeout=0;
        State=0;
      }

      delay(5);
      break;

    case 2:
      OK=1;
      State=0;
      break;

    default:
      State=0;
      break;

    }
  }
}
i really don't know :S
9  Forum 2005-2010 (read only) / Syntax & Programs / Matrix clock RTC on: October 24, 2010, 05:23:50 pm
Hi there,
I'm trying to make a nice clock for the master bedroom.
I got 4 rainbowdouino's with RGB matrixes on them.
it works great.

although I have no trouble trying to display the time of my "ladyada's log shield" over serial.

I want to display the time on the four matrixes so that every matrix just shows one number (only hours and minutes)

But i never worked with a RTC before so hoped to learn something here smiley-razz

If possible i love to have the seconds to but i dont know how.
32x8 pixels is a lot so it should work
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: string manipulation on: June 19, 2010, 04:50:27 pm
Yeah it works...

this is sort of what I had come up with myself but it din't work because of wstring being corrupt.

Thank you all

For intrested people here's the code.

Code:
#include <WString.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 5, 4, 3, 2); // MY LCD change to your needs
byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 150 }; // MY IP change to your needs
Server server(80);
String readString = String(100);
String finalstring = String(100);
int startpos = 10;
int endpos;


void setup(){
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  lcd.begin(16, 2);
  lcd.print("setup running");
}

void loop(){
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (readString.length() < 100){
          readString.append(c);
        }
        if (c == '\n') {
          if(readString.contains("msg")){
            // Magic :P
            lcd.clear();
            // last 11 have to be taken away.
            endpos = readString.length() - 11;
            // fisrt ten have to taken away.
            finalstring = readString.substring(startpos, endpos);
            // finish the line by replacing te + for a space.
            // since /GET commands translate spaces into +'s i chage it back :P
            finalstring.replace('+', ' ');
            lcd.print(finalstring);
          }

          // Now output HTML data starting with standart header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html><head><title>arduino msg board</title></head><body><center>");
          client.println("<form method=get>");
          client.println("<input type=text name=msg>");
          client.println("<input type=submit value=verstuur>");
          client.println("</form>");
// debug
// client.println(readString);
          client.println("</center></body></html>");
          readString="";
          client.stop();
        }
      }
    }
  }
}
// EOF *******************************

code for 16x2 LCD's
Code:
#include <WString.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 5, 4, 3, 2); // MY LCD change to your needs
byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 150 }; // MY IP change to your needs
Server server(80);
String readString = String(100);
String finalString = String(35);
String line1 = String(16);
String line2 = String(16);
int startpos = 10;
int endpos;
int lenght;


void setup(){
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  lcd.begin(16, 2);
  lcd.print("setup DONE!");
}

void loop(){
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (readString.length() < 100){
          readString.append(c);
        }
        if (c == '\n') {
          if(readString.contains("msg")){
            lcd.clear();
            endpos = readString.length() - 11;
            finalString = readString.substring(startpos, endpos);
            finalString.replace('+', ' ');
                lenght = finalString.length();
                if (lenght > 16){
              line1 = finalString.substring(0, 16);
              line2 = finalString.substring(16, finalString.length());
                  lcd.setCursor(0, 0);
                  lcd.print(line1);
                  lcd.setCursor(0, 1);
                  lcd.print(line2);
                }else{
                  lcd.setCursor(0, 0);
                  lcd.print(finalString);
                }
          }

          // Now output HTML data starting with standart header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html><head><title>arduino msg board</title></head><body><center>");
          client.println("<form method=get>");
          client.println("<input type=text SIZE=32 MAXLENGTH=32 name=msg>");
          client.println("<input type=submit value=verstuur>");
          client.println("</form>");
          client.println("</center></body></html>");
          readString="";
          client.stop();
        }
      }
    }
  }
}

only problem now is displaying special characters but if you try hard you can get them out/replaced to smiley-grin.
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: string manipulation on: June 19, 2010, 04:30:26 pm
mmm crap made that was it then gonna try it again smiley-razz
Thank you all!
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: string manipulation on: June 19, 2010, 06:58:31 am
just a quick reply the hole readstring is good and can be displayed on the lcd

just the substring doen'st seem to like me smiley-razz going to experiment a little bit more later today because i'm doing a laptop to DPF thing smiley-grin
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: string manipulation on: June 19, 2010, 04:57:26 am
This is what i have for now:

Code:
#include <WString.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 5, 4, 3, 2);
byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 150 };
Server server(80);
String readString = String(50);

void setup(){
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  lcd.begin(16, 2);
  lcd.print("setup running");
}

void loop(){
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (readString.length() < 50){
          readString.append(c);
        }
        if (c == '\n') {
          if(readString.contains("msg")){
            lcd.clear();
            // get msg form get command!
            // really need help here
            lcd.print("blabla");
          }

          // Now output HTML data starting with standart header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html><head><title>arduino msg board</title></head><body><center>");
          client.println("<form method=get>");
          client.println("<input type=text name=msg>");
          client.println("<input type=submit value=verstuur>");
          client.println("</form>");
          client.println(readString);
          client.println("</center></body></html>");
          readString="";
          client.stop();
        }
      }
    }
  }
}
// EOF *******************************

I can't get the msg out of the string.

I tried using this:
char end_value = readString.length();
String msg1 = readString.substring(10, end_value - 11);
but it returns nothing...

very annoying...

have confirmed the lcd and ethernet shield working smiley-grin so that aint the problem...
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: string manipulation on: June 16, 2010, 10:59:04 am
@zoomkat

could you post your complete code?
because i missing some pieces...

thank you smiley
15  Forum 2005-2010 (read only) / Syntax & Programs / string manipulation on: June 15, 2010, 04:10:11 am
Hello everybody I wanted my wifi robot to display a msg from my web controlling page.

So I'm using a 16x2 lcd with my ethernetshield and since i made a shiel for it taht uses the 11 and 12 pin i had to change them to 8 and 9  because ethernet shield uses 10..13.
I do have almost complete code but i can't get the lcd to display the msg i'll have to catch the msg from a GET response...

Code:
#include <WString.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 5, 4, 3, 2);
byte mac[] = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 150 };
Server server(80);
String readString = String(30);

void setup(){
  Serial.begin(9600);
  Ethernet.begin(mac, ip);
  lcd.begin(16, 2);
  lcd.print("setup running");
}

void loop(){
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (readString.length() < 30) {
          readString.append(c);
        }
        if (c == '\n') {
          if(readString.contains("msg")) {
            lcd.clear();
            // magic
            // characters between:
            // 'GET /?msg=' and  'HTTP/1.1'
            // are important!
            lcd.print("blabla");
          }

          // Now output HTML data starting with standart header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html><head><title>arduino ethernet msg board</title></head><body><center>");
          client.println("<form method=get>");
          client.println("<input type=text name=msg>");
          client.println("<input type=submit value=send>");
          client.println("</form>");
// debug
client.println(readString);
//
          client.println("</center></body></html>");
          readString="";
          client.stop();
        }
      }
    }
  }
}
// EOF *******************************

simple hello msg
Code:
GET /?msg=hello HTTP/1.1

first 10 can be discarted (i don't know how)
and last 9 can be discarted
problem is the msg is not always the same length.
and i don't know how to manipulate a string.
Pages: [1] 2 3 ... 12