Pages: 1 2 3 [4]   Go Down
Author Topic: arduino+vb6  (Read 9362 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For the arduino program load this to your hardware :

Try used ide2.2 version i dont know either it work with ino1.0 version

//----------------------------------------------------------------------------

int kaki[9]= {-1,2,3,4,5,6,7,8,9};
int baca[9]={0,0,0,0,0,0,0,0,0};

void setup() {
  Serial.begin(9600);
  for (int i = 1; i <= 8; i++) {
    pinMode(kaki, INPUT);
  }
}

void loop() {
  for (int i = 1; i <= 8; i++) {
    baca=digitalRead(kaki);
    Serial.print(baca,BYTE);
  }
    delay(100);
}


//-------------------------------------------------------------------------------

And the hardware setup is like this :

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To check what comport number your arduino is :

I assume you install all the driver needed and can used arduino.

Right click my computer select > properties > devices manager

now plugin usb cable to your arduino

look at Device Manage > Port (COM&LPT) it will show your arduino comport number.
*Take note the comport number and replace on vb 6 source code.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you so much for your reply majdi_mohammad.. smiley-surprise
i'll try this when the time i come home...
but before anything else, this code you posted the inputs are 8 supposedly it's only 4 because the other 4 are just an indicator of the first 4 if it works ( base on the arduino only)..well, again i'll try this.. smiley-draw


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code that i post will be:

8 pushbutton on arduino

when push the push button on arduino:

In vb6 will be change to red colour.

* I dont get how you want it be? maybe you can explain in detail how it will be? smiley-wink
 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello,
it's been a long time..by the way, i try your code for the arduino but when i use to compile this, there is an error occur in this code:
Code:
pinMode(kaki, INPUT)
which means invalid conversion from int* to 'unit8_t'..what does it mean?..

i used  the arduino version 0021

..thanks for keeping in touch.. smiley-wink
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello,
it's been a long time..by the way, i try your code for the arduino but when i use to compile this, there is an error occur in this code:
Code:
pinMode(kaki, INPUT)
which means invalid conversion from int* to 'unit8_t'..what does it mean?..

i used  the arduino version 0021

..thanks for keeping in touch.. smiley-wink
Code:
change pinMode(kaki, INPUT) to pinMode(kaki[i], INPUT)



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello majdi_mohammad, i just want your help on doing that below..i find hard to do this in vb because i there are many textboxes..
Quote
Create a new project and use the code below you need a put a label called (label1)and caption it "Com Port Number. add a communication object named (MSComm1). Put in a text box called
(ComPort). Add another longer text box called (text1). add a command button called (Command1)change the caption to "find com port". now add another text box called (text1).
Next add a shape object called (Shape1)
compile and run the code. Put the number of the com port into the text box called ComPort... just type in "1". click the command button and the other text box should show the pressure and the shape object should change colors.

Thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello retrolefty!

i change the code just like what you've suggested and yet it's okay but another thing appears as an error in this code:
Quote
Code:
baca=digitalRead(kaki);
that means invalid conversion from int* to 'unit8_t'.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 50009
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but another thing appears as an error in this code:
So, look at that that code is doing. It is trying to read from an array of pins, when it is designed to read from a pin. The function is not designed to take an array of pins, so the compiler is telling you that.
Logged

Pages: 1 2 3 [4]   Go Up
Jump to: