Show Posts
Pages: [1] 2
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Real Time Plotting Tool ( Oscilloscope ) on: October 21, 2011, 05:31:29 am
Ah. Pressing the reset button on the Arduino fixed it...
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Real Time Plotting Tool ( Oscilloscope ) on: October 21, 2011, 04:11:49 am
Hi,

I can't seem to get the SimPlot to actually plot something.
I tried loading both your arduino examples onto my Uno and neither of which display anything in SimPlot.
It would appears that it is opening the COM port but then after that there is not communication judging by the leds on my arduino board.
If I tried to connect to it via hyperterminal while SimPlot is connected then it tell me the port is in use basically. So I know if is connecting.
If I do connect to it in hyperterminal it sends out a whole bunch of data.
I'm hoping I'm not overlooking something simple here but there isn't all that many buttons to press.

Is the visual basic project available to the public?

Please see the screenshot below of the blank SimPlot.
3  Forum 2005-2010 (read only) / Troubleshooting / Re: Analogue Input 0-10V? on: April 15, 2010, 04:40:09 am
Can a OP please delete this, I can't seem to figure it out
4  Forum 2005-2010 (read only) / Interfacing / Re: Arduino + Twitter + LEDs on: March 10, 2010, 05:28:09 am
I am kind of new at this and struggle a bit with programming.
I did however write a program a while back for Visual Basic that sent information constantly to the arduino.

There are libraries available for Visual Basic and I am sure there must be some for C applications.
Although I think you may be better off with C++

As far as I can remember in my program I just had to setup up the serialport, baud rate etc.
And then just used some form of Serial.write type of command. Which was obviously possible due to including some sort of library. (I think it was MSCOMM or something like that).

It was also in some form of loop that updated the value I was sending.

I found this for C++:
http://www.codeproject.com/KB/system/serial.aspx

Hope this helps.
If anyone has any input please add it as my experience with C and C++ is limited... :-?
5  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Duemilanove and VirtualWire on: March 10, 2010, 02:13:36 am
Ok, if I have any other issues I will be sure to post them.

I am still waiting on the components so when I get them I will let you know how it works when they arrive.

Thanks a million for the help! I would still be stuck if it weren't for the helpful people here.
6  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Duemilanove and VirtualWire on: March 10, 2010, 01:46:02 am
Thanks for the reply.
Is there anyway to show the decimal value in the serialport monitor instead of the ascii.
I put your piece of code in so it looks like this:

Code:
char *msg = "0";
  POTVAL = analogRead(POTPIN); // read value from potentiometer
  PWMVAL = map(POTVAL, 0, 1023, 0, 255); // map the value so that it can be used for PWM signal
  msg[0] = PWMVAL;
  test = msg[0];
  Serial.println(test,DEC);
  vw_send((uint8_t *)msg, strlen(msg));
  vw_wait_tx(); // Wait until the whole message is gone

  delay(500);


This seems to work and what I see in the serialport monitor when varying  the potentiometer from one end to the other is a decimal number between 0-255.

I only included the 'test' variable to make sure that the correct value is being sent.

When I leave the serial print as; Serial.println(msg) then I get a majority or the ascii characters changing in the correct order.
I don't think the monitor can display all the characters as a couple of squares and blank lines show up.

Now for the receiver side of things I was thinking of something like this:

Code:
#include <VirtualWire.h>

byte PWMVAL = 0;
int PWMOUT = 3;

void setup()
{
    Serial.begin(9600);      // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec

    vw_rx_start();       // Start the receiver PLL running
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
       PWMVAL = buf[0];
         analogWrite(PWMOUT,PWMVAL);
  
        
    }
}


I am not so sure if this line PWMVAL = buf[0]; is going to work.
It compiles with no errors.

Any ideas? It may work or may not work  :-/




7  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Duemilanove and VirtualWire on: March 09, 2010, 07:44:25 am
Using your section of code, it complains here "vw_send(&PWMVAL, 1);" with this message "error invalid conversion from 'const unint8_t*' to 'uint8_t*'"
If I remove the 'const' infront of the const uint8_t PWMVAL.. then it complies fine.
I don't actually have the modules yet to test but am working on the program so long.
I do however have the potentiometer hooked up.
If I open the serial port monitor I am seeing what appears to be ascii, if I vary the potentiometer fairly quickly I get something like this (ûóúãjkÚãj
kkjkÚâþJÿJÿjÿJÿKÿkÿKÿj*k)

I am posting the example code from the library files as well. Hopefully it might clear up what I am trying to change.

Transmitter code:

// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);        // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec
}

void loop()
{
    const char *msg = "hello";

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(200);
}


Receiver Code:

// receiver.pde
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
    Serial.begin(9600);      // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec

    vw_rx_start();       // Start the receiver PLL running
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
      int i;

        digitalWrite(13, true); // Flash a light to show received good message
      // Message with a good checksum received, dump it.
      Serial.print("Got: ");
      
      for (i = 0; i < buflen; i++)
      {
          Serial.print(buf, HEX);
          Serial.print(" ");
      }
      Serial.println("");
        digitalWrite(13, false);
    }
}




So obviously instead of the message 'hello' I wish to send my analog data
8  Forum 2005-2010 (read only) / Interfacing / Arduino Duemilanove and VirtualWire on: March 09, 2010, 05:50:15 am
Hi all,

I had this posted in the hardware>interfacing section, but I think it is more of a software issue...

I came across this http://www.glacialwanderer.com/hobbyrobotics/?p=291 and thought that it was an awesome idea.
I have been looking at this more however as he uses VirtualWire:
http://www.benjohansen.com/archives/642

I plan to use the VirtualWire library www.open.com.au/mikem/arduino/VirtualWire.pdf.
And these transmitters and receivers:
http://www.sparkfun.com/commerce/product_info.php?products_id=8945
http://www.sparkfun.com/commerce/product_info.php?products_id=8948

I am having trouble understanding the example that comes with the library for both transmitter and receiver.
I wish to read a value from an analog input and  then send it to the receiver where it will be used for a PWM output.

My transmitter code looks something like this:

#include <VirtualWire.h>

int POTPIN = 0;
int POTVAL = 0;
byte PWMVAL = 0;
// int PWMOUT = 3;

void setup()
{
   Serial.begin(9600);        // Debugging only
   Serial.println("setup");

   // Initialise the IO and ISR
   vw_set_ptt_inverted(true); // Required for DR3100
   vw_setup(2000);       // Bits per sec
}

void loop()
{
   const char *msg;
   POTVAL = analogRead(POTPIN); // read value from potentiometer
   PWMVAL = map(POTVAL, 0, 1023, 0, 255); // map the value so that it can be used for PWM signal
   msg = "PWMVAL";
   Serial.println(msg);
   vw_send((uint8_t *)msg, strlen(msg));
   vw_wait_tx(); // Wait until the whole message is gone
 
   delay(100);
}


One of my problems is that I do not want to send characters and instead just one byte of the value from mapped analog value.
I am unsure of how to adapt the code for my project Sad

If anyone has any advice I would greatly appreciate it.

Thanks in advance.
9  Forum 2005-2010 (read only) / Interfacing / Re: Serial data from visual basic. Help needed! on: March 31, 2009, 12:47:59 am
Thanks for the help, I will be sure to check that out. Still waiting for my Arduino to come but I figured I would get started so long smiley

Thanks again
10  Forum 2005-2010 (read only) / Interfacing / Serial data from visual basic. Help needed! on: March 30, 2009, 04:17:52 pm
Hi all,
I am very new to this and need a little help smiley-sad
I have made a program that sends information through the serial port, this was done in visual basic.
The numbers that are being sent vary from 0 to over 10000. I need to convert this to a servo position between 0 and 180.
Any ideas? I was thinkin i should try and convert it in the visual basic program before sending it, although my vb programming is not very good.

Thanks in advance for any help
11  Forum 2005-2010 (read only) / Interfacing / Re: Arduino and VirtualWire on: June 15, 2010, 11:36:46 am
Thanks. I managed to receive help for this in the software section and it sorted my problems

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1268131815

I had a read through your link and various other error checking methods.
After a bit of experimentation I found the VirtualWire worked best once I got it to send what I wanted.

Thanks again
12  Forum 2005-2010 (read only) / Interfacing / Arduino and VirtualWire on: March 09, 2010, 01:28:29 pm
Hi all,

I have posted something similar in the software/interfacing section, but I am not so sure what it falls under now.

I came across this http://www.glacialwanderer.com/hobbyrobotics/?p=291 and thought that it was an awesome idea.
I have been looking at this more however as he uses VirtualWire:
http://www.benjohansen.com/archives/642

I plan to use the VirtualWire library http://www.open.com.au/mikem/arduino/VirtualWire.pdf.
And these transmitters and receivers:
http://www.sparkfun.com/commerce/product_info.php?products_id=8945
http://www.sparkfun.com/commerce/product_info.php?products_id=8948

I am having trouble understanding the example that comes with the library for both transmitter and receiver.
I wish to read a value from an analog input and  then send it to the receiver where it will be used for a PWM output.

My transmitter code looks something like this:

#include <VirtualWire.h>

int POTPIN = 0;
int POTVAL = 0;
byte PWMVAL = 0;
// int PWMOUT = 3;

void setup()
{
  Serial.begin(9600);        // Debugging only
  Serial.println("setup");

  // Initialise the IO and ISR
  vw_set_ptt_inverted(true); // Required for DR3100
  vw_setup(2000);       // Bits per sec
}

void loop()
{
  const char *msg;
  POTVAL = analogRead(POTPIN); // read value from potentiometer
  PWMVAL = map(POTVAL, 0, 1023, 0, 255); // map the value so that it can be used for PWM signal
  msg = "PWMVAL";
  Serial.println(msg);
  vw_send((uint8_t *)msg, strlen(msg));
  vw_wait_tx(); // Wait until the whole message is gone

  delay(100);
}


One of my problems is that I do not want to send characters and instead just one byte of the value from mapped analog value.
I am unsure of how to adapt the code for my project Sad.

The original example code from the VirtualWire library is as follows:

Transmitter code:

// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
   Serial.begin(9600);        // Debugging only
   Serial.println("setup");

   // Initialise the IO and ISR
   vw_set_ptt_inverted(true); // Required for DR3100
   vw_setup(2000);       // Bits per sec
}

void loop()
{
   const char *msg = "hello";

   digitalWrite(13, true); // Flash a light to show transmitting
   vw_send((uint8_t *)msg, strlen(msg));
   vw_wait_tx(); // Wait until the whole message is gone
   digitalWrite(13, false);
   delay(200);
}


Receiver Code:

// receiver.pde
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()
{
   Serial.begin(9600);      // Debugging only
   Serial.println("setup");

   // Initialise the IO and ISR
   vw_set_ptt_inverted(true); // Required for DR3100
   vw_setup(2000);       // Bits per sec

   vw_rx_start();       // Start the receiver PLL running
}

void loop()
{
   uint8_t buf[VW_MAX_MESSAGE_LEN];
   uint8_t buflen = VW_MAX_MESSAGE_LEN;

   if (vw_get_message(buf, &buflen)) // Non-blocking
   {
     int i;

       digitalWrite(13, true); // Flash a light to show received good message
     // Message with a good checksum received, dump it.
     Serial.print("Got: ");
    
     for (i = 0; i < buflen; i++)
     {
         Serial.print(buf, HEX);
         Serial.print(" ");
     }
     Serial.println("");
       digitalWrite(13, false);
   }
}



If anyone has any advice I would greatly appreciate it.

Thanks in advance.
13  Forum 2005-2010 (read only) / Interfacing / Re: selecting a waterpump to use with arduino on: May 04, 2010, 11:42:08 pm
Just remember that the windshield wiper pumps are not meant to run for very long. They tend to burn out after a while.

You can try camping shops, they sometimes have small pumps.
14  Forum 2005-2010 (read only) / Interfacing / Re: Moisture meter input on: April 29, 2010, 11:45:19 pm
Hi,

I assume you are using an analog input for your moisture sensor? Or is the meter a stand alone thing?

If you are using an analog input it should'nt be to hard to output that value to the servo using the servo library.

However if it is standalone you can maybe use a light sensor, or remove the led and place either an optocoupler there or interface it directly to a digital input on the arduino.
Obviously just make sure that the voltage is at the correct level for the arduino.

Hope this helps, you may want to see if anyone else replies as sometimes I am just guessing....

Goodluck
15  Forum 2005-2010 (read only) / Interfacing / Re: Moisture meter input on: March 10, 2010, 09:03:11 am
I think you may need a resistor inline with your LED depending on what pin you use.

http://arduino.cc/en/Tutorial/Blink
Pages: [1] 2