Show Posts
Pages: 1 2 3 [4]
46  Forum 2005-2010 (read only) / Interfacing / Re: visual basic serial communication on: January 19, 2011, 10:08:03 am
Thanks guys.
I coult send value to Arduino, but I cant retrieve values to place in VB...

I tried the code you posted, no luck... I stil can't retrieve values.

-Andy
47  Forum 2005-2010 (read only) / Interfacing / visual basic serial communication on: January 19, 2011, 05:46:58 am
Hi All.
I've been searching all over the web for this problem. I Can't find anny tutorials that works.

I have a Arduino Duemilanove, with a temp sensor, 2 led lights and two pushbuttoms.

What I wanna do, is to make a software for windows in visual basic.
And I need to communicate between Arduino and computer.

I've made a soft and managed to turn led on of by pressing buttoms on skreen, but I don't manage to show temp sensor value in visual basic.
Later I'd like to have several temp sensors showing on screen.

Annyone know how to read serial communication from arduino?
HEEEELP  :-/

-Andy

* Code *
--------------------------------------------------------------
* arduino *
#include <math.h>

int ledPin      = 10;           // the number of the LED pin
int buttonPin2  = 2;            // the number of the pushbutton pin
int incomingByte;

double Thermistor(int RawADC) {
  double Temp;
  Temp  = log(((10240000/RawADC) - 10000));
  Temp  = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
  Temp  = (Temp - 273.15);            // Celcius
  //Temp  = ((Temp * 9.0)/ 5.0 + 32.0); // Fahrenheit
  return Temp;
}

void setup() {
  Serial.begin(19200);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin2, INPUT);  
}

void loop(){
    if (Serial.available() > 0) {
         incomingByte = Serial.read();
         if (incomingByte == 'A') {
              digitalWrite(ledPin, HIGH);
         }
         if (incomingByte == 'B') {
              digitalWrite(ledPin, LOW);
         }
    }
       Serial.println(int(Thermistor(analogRead(0))));
      //delay(100);      
}

--------------------------------------------------------------
* Visual Basic *
Imports System.IO
Imports System.IO.Ports
Imports System.Threading

Public Class Form1
    Shared _continue As Boolean
    Shared _serialPort As SerialPort

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With SerialPort2
            .Close()
            'Set the serial port you want to use.
            .PortName = "COM6" 'You MUST put 'COM' before the COM number.

            'Set baud rate, parity, data bits, and stop bits.
            .BaudRate = 19200
            .Parity = Parity.None
            .DataBits = 8
            .StopBits = StopBits.One

            'Set DTR and RTS
            .DtrEnable = True
            .RtsEnable = True

            'Set number of bytes before DataRecieved event is raised.
            .ReceivedBytesThreshold = 1

            'Open serial port.
            .Open()
        End With
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SerialPort2.Write("A")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        SerialPort2.Write("B")
    End Sub

End Class
--------------------------------------------------------------
 smiley-grin
48  Forum 2005-2010 (read only) / Interfacing / Re: Win exe to arduino on: January 16, 2011, 07:52:28 am
FCK!!!
I knew I forgot something...
Annyone know of a god tutorial for this? Or send me a exsample code for this...

-Andy
49  Forum 2005-2010 (read only) / Interfacing / Win exe to arduino on: January 16, 2011, 07:10:14 am
Hi all.  smiley
This has certainly been discussed before. But I want to make a windows based software, communicating with the arduino.
What I want to do, is to read the inputs and outputs from arduino, in a software made in visual basic or visual C++ on my computer.
I also need to be able to send values as well to the arduino, set new setpoints, move a servo by moving a joystick...

Best,
-Andy
50  Forum 2005-2010 (read only) / Scandinavia / Re: elektronisk styring av lys hjemme on: January 05, 2011, 06:37:25 am
Takker for kjapt svar smiley-grin
Dette må med knote leenge med ser det ut som...
51  Forum 2005-2010 (read only) / Scandinavia / elektronisk styring av lys hjemme on: January 04, 2011, 06:33:26 pm
Hei, hei.
Jeg har ett lite hjemmeprosjekt, hvor jeg skal prøve å styre lys og varme, +++ fra laptoppen som et SD anlegg.

Da har jeg en arduino koblet til en nettverksmodul.
Men mitt store problem er da elektronikk delen. Den er ikke jeg flink på.
Det jeg trenger hjelp til nå er Lys dimme delen. smiley-sad
Da blir vel det å ha en "trafo" 0-230v AC som styres fra 0-5 DC fra arduinoen.

Ved 0v DC, gir 0V AC ut av trafoen.
Ved 5v DC, gir230v AC ut av trafoen.
Denne spenningen skal da være variabel.
Den får signal fra en lysbryter som du dimmer lyset opp eller ned.

Noen som har noe å gi meg her? Eller hjelpe meg på vei...

Jeg er blank på denne delen smiley-sad
-André  smiley
52  Forum 2005-2010 (read only) / Scandinavia / Re: Windows program å styre arduino on: January 17, 2011, 06:10:23 am
Ikke helt Christian.
Men skal utdype mer.
I min arduino, har jeg en trykknapp som jeg kaller "switch0" og utgang til lys som jeg kaller for "Led0".
Jeg skulle da laget ett program for PC, som jeg kan ha en "bryter" og ett lys som lyser på skjermen.
Dette programmet jeg lager, må kunne ha en kommunikasjon med arduino "live".
Når jeg da trykker på knappen i dataprogrammet, sender den data til arduinoen som så setter utgangen "Led0" høy.
Da sender arduinoen signal til pc om at "Led0" er høy, og jeg simulerer dette med ett lys blir tent på PC.

-Andy  smiley-grin
53  Forum 2005-2010 (read only) / Scandinavia / Windows program å styre arduino on: January 16, 2011, 06:53:27 am
Hei.
Jeg har ikke funnet noen form for "tutorial" for å lage ett dataprogram til å styre arduinoen.
Jeg ville laget ett program som leser innganger fra ARD og som kan sette utgangene på ARD.
Noen som har en link eller liknende for dette?
Helst noe for Visual basic, men C++ går og bra...

-Andy
54  Forum 2005-2010 (read only) / Development / Re: send and receive from arduino on: October 07, 2010, 05:13:42 am
I have an Arduino Dua ... board. I want it to be in contact (wireless) with a temperature sensor. The sensor provides a signal to a relay that pulls when determining need for heat.

 smiley
55  Forum 2005-2010 (read only) / Development / send and receive from arduino on: October 03, 2010, 07:48:16 am
Hi. I want to create a control where I will send a signal from an Main Arduinocard to another Arduino card where the card triggers a relay, and sends a signal back to the Main Arduino board.
This will be done wirelessly. How can I make this radio controller?

Andy
56  Forum 2005-2010 (read only) / Development / Memsic 2125 Accelerometer on: October 04, 2010, 08:47:59 am
Hi.
I've been looking at this video. http://blog.makezine.com/archive/2009/04/how-to_tuesday_arduino_101_accelero.html

From Y & X axis you conect it to digital in. But you get a value different from 0 & 1. How come?
57  Forum 2005-2010 (read only) / Interfacing / Re: electronic trafo on: January 05, 2011, 06:30:40 am
Hi Richard.  smiley
In fact I'm a electrical engineer. But in last 6 years I've only been working with PLC systems. And I'm allowed to work with power up to 1090 v AC. I live in Norway by the way.
But now I want to see a little more basic in the electronics section. Learning about the structure of the parts so that I can create components for myself.

But low power electronics for me, is much harder to understand. Since this wasn't my primary education. I did some at school, so I do understand the basic of low power electronics.

Back to question...
I will use this to fade light up or down when you press a switch. Arrow up, light get brighter. Arrow down, the light gets weaker.
Or use arduino to program a wakeup function or use my computer to control the light.
You mention the "X-10". It's probably something similar of this I want. But as I mentioned earlier, I wanna learn how things work as well...

Best,
Andy  smiley-grin
58  Forum 2005-2010 (read only) / Interfacing / electronic trafo on: January 04, 2011, 05:54:40 pm
Hi smiley
I just wonder if anyone can help me?
I want to make a wireless controlled light dimmer.
I will use arduino to control my lights from my computer.

What I need is to make a trafo 0-230v AC to the lights.
Transformer must be electronic, and controlled by arduinos 0-5v DC.
I'm a bit unsure of how I could to control 0-5VDC to 0-230VAC.

Annyone?

Best,
Andy
Pages: 1 2 3 [4]