Show Posts
Pages: [1] 2
1  Using Arduino / LEDs and Multiplexing / Re: 8x8 programming help on: December 03, 2012, 10:17:12 am
okay, i finaly got it to work!!

i work with an int(16b) to display a 8bit(8 leds) led colom.
i bitshift 8 times to the left and then OR this with another int and itself.
like this:
  printset[0][a]=dataset[dispthis][a]<<8;
  printset2[0][a]=printset[0][a]|dataset[dispthis2][a]; 

now i get two characters behind eachother, then scroll them to the left.
When it scrolls 7 times i do the above trick again.
This in a loop will do the thing.

Short video: http://marceldunk.blogspot.nl/2012/12/draaloze-temperatuur-en.html

gr,

Marcel
 
2  Using Arduino / LEDs and Multiplexing / Re: 8x8 programming help on: December 01, 2012, 09:25:07 am
I have uploaded a video so you can see what i mean:
http://marceldunk.blogspot.nl/2012/12/8x8-led-scroll-text.html
3  Using Arduino / LEDs and Multiplexing / 8x8 programming help on: December 01, 2012, 09:15:44 am
Hi,

Can somebody help me with i think is a simple problem.
i broke my mind thinking how to do it.... but haven't found the solution.

I have an 8x8 led matrix working with my arduino.
setup like this: http://marceldunk.blogspot.nl/2012/09/4-leds-with-2-74ch595.html

i want to make a textscroll program. I have this code, but the scroll is not continues...
I want to scroll the next character if the first is full shown-1.
Now it scrolls the character from right to left. When the character left the 8x8led on the left (so 8x8 is clean) than the next character is comming on the right. So i have a gab of 8 positions (maybee 6, i don't want then to get close together)

Code:
//8x8 led//

const int num_rows=8;
const int num_cols=8;

const int clockpinrow=10; //pin 11 van de 74ch595
const int rowdatapin=8; //pin 14 van de 74ch595
const int rowlatchpin=9; //pin 12 van de 74ch595

const int clockpincol=13; //pin 11 van de 74ch595
const int coldatapin=11; //pin 14 van de 74ch595
const int collatchpin=12; //pin 12 van de 74ch595

int printset[2][8]= {0};
int dataset[12][8] = {{
B01111110,
B11000011,
B11000011,
B11000011,
B11000011,
B11000011,
B11000011,
B01111110},
{
B00011000,
B01111000,
B00011000,
B00011000,
B00011000,
B00011000,
B01111110,
B11111111},
{
B00111100,
B01100110,
B00000110,
B00001100,
B00011000,
B00110000,
B11111111,
B11111111},
{
B01111110,
B11000110,
B00000011,
B00111111,
B00111111,
B00000011,
B11000110,
B01111110},
{
B00000011,
B00001111,
B00011011,
B00110011,
B01100011,
B11111111,
B00000011,
B00000011},
{
B01111111,
B11000011,
B11000000,
B01111110,
B00000011,
B00000011,
B00000110,
B11111100},
{
B00000110,
B00001100,
B00011000,
B00110000,
B01111110,
B11000111,
B11000011,
B01111110},
{
B11111110,
B11000011,
B00000011,
B00000011,
B00000011,
B00000011,
B00000011,
B00000011},
{
B01111110,
B11000011,
B11000011,
B01111110,
B01111110,
B11000011,
B11000011,
B01111110},
{
B01111110,
B11000011,
B11000011,
B01111111,
B00000011,
B00000011,
B00000110,
B11111110},
{
B01100110,
B10010010,
B10010010,
B01101111,
B01100011,
B10010101,
B00101111,
B11110001},
{
B00010000,
B00101000,
B00010000,
B00000000,
B00000000,
B00010000,
B00101000,
B00010000}};


void setup() {
  pinMode(clockpinrow, OUTPUT);
  pinMode(clockpincol, OUTPUT);
  pinMode(rowdatapin, OUTPUT);
  pinMode(coldatapin, OUTPUT);
  pinMode(rowlatchpin, OUTPUT);
  pinMode(collatchpin, OUTPUT);
}

void loop() {
     for (int del=0;del<4;del++){
         for (int q=0;q<10;q++){
             for (int b=8;b>-1;b--){
                  for (int a=0;a<8;a++){
                      printset[0][a]=dataset[q][a]>>b;
                      }
                  displayPixels(0,del);
                  }
                  for (int b=1;b<8;b++){
                       for (int a=0;a<8;a++){
                            printset[0][a]=dataset[q][a]<<b;
                            }
                       displayPixels(0,del);
                       }
          }
    }
}

void displayPixels(int val, int delay){
  for (int i=0; i<delay; i++){
    for (int col=0; col<num_cols; col++){
      shiftOut(coldatapin, clockpincol, MSBFIRST, 255-(B00000001 << col));
        digitalWrite(collatchpin, HIGH);
        digitalWrite(collatchpin, LOW);
      int cur =printset[val][col];
      shiftOut(rowdatapin, clockpinrow, MSBFIRST, cur);
        digitalWrite(rowlatchpin, HIGH);
        digitalWrite(rowlatchpin, LOW);
        delayMicroseconds(2000);
    shiftOut(rowdatapin, clockpinrow, MSBFIRST, 0);
      digitalWrite(rowlatchpin, HIGH);
      digitalWrite(rowlatchpin, LOW);
  }
  }
}

So can anybody help me with this program?

Thanks,

Marcel
4  Using Arduino / LEDs and Multiplexing / Re: 8x8led matrix troubles with 2x 74CH595 on: September 21, 2012, 12:01:03 am
Hi Mike,

thanks for youre comment. I thought about that, but i saw a lot of tuto's on the internet that hasn't used them.
Look at this one:

but when i do use one, wich is the best one to use?

by the way:
i did mention to get the 4 leds working now with two 74hc595's!  FINALY..
What a great evening!!!

Now i'm going to replace the 8x8 matrix to test some things.

thanks.
5  Using Arduino / LEDs and Multiplexing / 8x8led matrix troubles with 2x 74CH595 on: September 19, 2012, 01:09:05 pm
I bought a couple of 8x8 led matrices on ebay. I tested them with a resistor and a 5v power supply. I managed to find out the right connection to led up every dot. Works fine!

So the next step was to make drive it with the arduino. I ordered two 74c595 chips. One for the anode, and one for the cathode.
A couple of resistors in between.

It didn't work, so i broke it down. I decided to set up 4 leds with the same idea. One side to the resistors and the 74ch595 and other side to another 74ch595.
So when i set the first bit of the 74ch595 to 1(+5V) and the first bit of the other 74ch595 to 0(0V) then the led must lit.
Otherway around it stays off.

my code:
Code:
// simple 4 led setup.
// 2x 74ch595, 1 for anode, 1 for kathode
// use to test with troubles with 8x8led matrix common anode.
// 4 pins of the 74ch595 are used (A0-A3)


int latchrow = 12; //pin 11 74ch595
int latchcol = 10; //pin 11 74ch595
int clockPin = 9; //pin 12 74ch595
int datarow = 11; //pin 14 74ch595
int datacol = 8;//pin 14 74ch595


byte ledcol = B00001111;
byte ledrow = B00001101;

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchrow, OUTPUT);
  pinMode(latchcol, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(datarow, OUTPUT);
  pinMode(datacol, OUTPUT);
}

void loop() {
  digitalWrite(latchrow, LOW);
   shiftOut(datarow, clockPin, MSBFIRST, ledrow);
  digitalWrite(latchrow, HIGH);

  digitalWrite(latchcol, LOW);
  // shift the bits out:
  shiftOut(datacol, clockPin, MSBFIRST, ledcol);
    // turn on the output so the LEDs can light up:
  digitalWrite(latchcol, HIGH);
}

more info here.
http://marceldunk.blogspot.com/2012/09/4-leds-with-2-74ch595.html


Sorry for the bad english......


grtx,

Marcel

6  Using Arduino / Networking, Protocols, and Devices / Re: RF433 and virtualwire (char-problem) on: March 31, 2012, 12:34:47 pm
I solved the problem. Done a lot of debugging.....
the ethernet string doesn't reset in my code.

That was it!

thanks all.
7  Using Arduino / Networking, Protocols, and Devices / RF433 and virtualwire (char-problem) on: March 29, 2012, 01:56:38 pm
Hi,

I am working on my arduino2arduino communication project. Want to make my gardenlights go on and off with my Android-phone (website).

I tested all parts as modules and it looks good.

I use a 433rf trans and recieve module and the virtualwire.lib.
The webserver on the transside is looking for a button to press, when it is i want to change the *msg value.
In my setup i set the msg value to: GALLO.
When the button are pressed i want to change it to: "A" / "U" / "1" etc etc.
But i can't get it to work. (the msg char is not chancing).
I think i have a problem to define the msg char.

Can anybody check my code and help me a little bit?



Code:
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round

#include <SPI.h>
#include <Ethernet.h>

long versie=1556;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 254, 200 }; // ip in lan
byte gateway[] = { 192, 168, 254, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); //server port

String readString;

//////////////////////
int ledvalue=125;
int index=0;
int temp[30];
int sensorPin = A5;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor
int sdcard=4;
int sdcardoff=HIGH;
char *msg="GALLO";

void setup(){
  
  pinMode(5, OUTPUT); //pin selected to control
    
    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_set_tx_pin(8);
    vw_setup(2000); // Bits per sec
    
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  //enable serial data print
  Serial.begin(9600);
  Serial.println("server LED test 1.0"); // so I can keep track of what is loaded
  Serial.println(versie);
  pinMode(sdcard,sdcardoff);
}

void loop(){
  RFtrans();
  ledcontrol();
}

int ledcontrol(){
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string
          readString += c;
          //Serial.print(c);
        }

        //if HTTP request has ended
        if (c == '\n') {

          ///////////////
          
      //    Serial.println(readString); //print to serial monitor for debuging
        
          client.println("HTTP/1.1 200 OK"); //send new page
          client.println("Content-Type: text/html");
          client.println();
          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Arduino GET test page</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");
          client.println("<H1>Arduino Webpage</H1>");
          client.println("Versie: ");
          client.println(versie);
          client.println("<br><br>");
          client.println("<b>Led<br></b>");
          client.println("Ledvalue:");
          client.println(ledvalue);
          client.println("<br>");  
          client.println("<a href=\"/?aan\"\">Led aan</a>");
          client.println(" ---- ");
          client.println("<a href=\"/?uit\"\">Led uit</a><br><br>");
          client.println(" ---- ");
          client.println("<a href=\"/?35\"\">Led aan 1 minuut</a>");
          client.println(" ---- ");
          client.println("<a href=\"/?70\"\">Led aan 5 minuten</a>");
          client.println(" ---- ");
          client.println("<a href=\"/?150\"\">Led aan 2 uur</a>");
          client.println(" ---- ");
          client.println("<br><br><b><a href=\"/\"\">Clearpage</a></b>");  
          client.println("</BODY>");
          client.println("</HTML>");
 
          //stopping client
          client.stop();


        if(readString.indexOf("?aan") >0){//checks for off
        Serial.print("AAN");
        const char *msg = "A";
RFtrans();
        }
        
        if(readString.indexOf("?uit") >0){//checks for off
        char *msg = "U";
        Serial.print("UIT");
        RFtrans();
        }
        
        if(readString.indexOf("?35") >0){//checks for off
        char *msg = "1";
RFtrans();
        }
        
        if(readString.indexOf("?70") >0){//checks for off
        char msg = '5';
RFtrans();
        }
        
        if(readString.indexOf("?150") >0){//checks for off
        char msg = '2';
RFtrans();
        }
      
        }
        }

      }
    }
  }

int RFtrans(){
    Serial.print("MSG: ");
    Serial.println(msg);
    analogWrite(6, 255); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    analogWrite(6, 0);
    delay(200);
}
8  Using Arduino / LEDs and Multiplexing / Re: 8x8 bi color ledmatrix simple test on: March 23, 2012, 03:03:30 pm
Yes, i thought so too.
hmmmm

I did the following:
placed a 560r to +5v, connected the otherside of the resistor to pin 1.
took another wire and connected it to pin 13, the other end to -(gnd).

But nothing, not even on another 8x8 bi color led.
https://picasaweb.google.com/lh/photo/MxIglO5K0jpcGt_D4PJAZ9MTjNZETYmyPJy0liipFm0?feat=directlink

HELP......


Grtx,

Marcel
9  Using Arduino / LEDs and Multiplexing / 8x8 bi color ledmatrix simple test on: March 23, 2012, 02:35:29 pm
Hi,

I bought a very cheap 8x8 ledmatrix bi color (red/green). Can anybody tell me test it (fast and simple)?
Can i just connect 2 wires to my arduino(uno)and the pins to test the leds?

for example:
use the blink example to use as input for the matrix.....

Grtx,

Marcel

10  Using Arduino / Networking, Protocols, and Devices / Re: Virtualwire lib problem on: March 22, 2012, 03:15:35 pm
Paul,

Thanks, i did it right away. But it left me with the next error codes.....


transmitter.cpp: In function 'void setup()':
transmitter.pde:-1: error: 'vw_set_ptt_inverted' was not declared in this scope
transmitter.pde:-1: error: 'vw_setup' was not declared in this scope
transmitter.cpp: In function 'void loop()':
transmitter.pde:-1: error: 'vw_send' was not declared in this scope
transmitter.pde:-1: error: 'vw_wait_tx' was not declared in this scope

It looks like the arduino software doesn't read the lib good.

Gr,

Marcel
11  Using Arduino / Networking, Protocols, and Devices / Virtualwire lib problem on: March 22, 2012, 02:30:25 pm
Hi,

I hope i post this on the right group.

I having problems with Arduino 1.0 and even r22 and the virtualwire library. I can't get it working!

I use the simple example from the lib. When i verify the code i get errorcodes like this:

In file included from transmitter.cpp:11:
C:\Users\prive\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:14:20: error: wiring.h: No such file or directory
In file included from transmitter.cpp:11:
VirtualWire.h:53: error: variable or field 'vw_set_tx_pin' declared void
VirtualWire.h:53: error: 'uint8_t' was not declared in this scope
VirtualWire.h:57: error: variable or field 'vw_set_rx_pin' declared void
VirtualWire.h:57: error: 'uint8_t' was not declared in this scope
VirtualWire.h:61: error: variable or field 'vw_set_ptt_pin' declared void
VirtualWire.h:61: error: 'uint8_t' was not declared in this scope
VirtualWire.h:65: error: variable or field 'vw_set_ptt_inverted' declared void
VirtualWire.h:65: error: 'uint8_t' was not declared in this scope
VirtualWire.h:70: error: variable or field 'vw_setup' declared void
VirtualWire.h:70: error: 'uint16_t' was not declared in this scope
VirtualWire.h:89: error: 'uint8_t' does not name a type
VirtualWire.h:95: error: 'uint8_t' does not name a type
VirtualWire.h:98: error: 'uint8_t' does not name a type
VirtualWire.h:103: error: 'uint8_t' does not name a type
transmitter.cpp: In function 'void setup()':
transmitter.pde:-1: error: 'vw_set_ptt_inverted' was not declared in this scope
transmitter.pde:-1: error: 'vw_setup' was not declared in this scope
transmitter.cpp: In function 'void loop()':
transmitter.pde:-1: error: 'vw_send' was not declared in this scope


What am i doing wrong??

Gr.

Marcel
12  Using Arduino / Networking, Protocols, and Devices / Re: RF413 simple test to check if the hardware is working.... on: March 19, 2012, 03:30:43 pm
I've never seen anyone get Virtualwire to both output and input at the same time.
You are testing with 2 arduino's, one transmitting and 1 receiving?

Yes, 2 arduino's. One is sending data, the other is recieving.
Want to make a weatherstation.....

Please post a RD413 spec.
Here are some specs:
http://www.geeetech.com/433mhz-rf-link-kit-p-160.html

Gr.
13  Using Arduino / Networking, Protocols, and Devices / RF413 simple test to check if the hardware is working.... on: March 19, 2012, 03:17:34 pm
Hi,

I bought my RD413kit from ebay... Yes, sorry guys. But the price was so good i thought lets have a try.
Now i'm testing the kit. But it doesn't do what i'm thinking it should. So, it does nothing at all (hahaha).

I'm using a this kit: http://arduino.cc/forum/index.php?topic=78470.0
I used the threat for the pin-layout. I hope that's okay.

I'm using the virtualwire lib.

Can anybody tell me how i can test the kit?
So i can be sure it is working, or not. If it is not i'm going to mail the ebay seller.
If it is, i'm very happy. LOL

thx,

Marcel


14  Using Arduino / Sensors / Re: Help with DHT11 on: March 17, 2012, 01:52:19 pm
Okay i found this link on a dif forum:
http://nootropicdesign.com/forum/viewtopic.php?t=2434

the include for Wprogram.h is compatible with Arduino1.0???? You must include arduin.h ??
Weird.....

But it works now!

15  Using Arduino / Sensors / Re: Help with DHT11 on: March 17, 2012, 01:46:38 pm
I think i have a problem with the paths on my laptop.

This is the error i get now!

In file included from DHT11.cpp:8:
C:\Program Files (x86)\arduino-1.0\libraries\DHT11/dht11.h:19:22: error: WProgram.h: No such file or directory

Pages: [1] 2