Loading...
  Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Can I set pins 27, 28 to digital INPUT OUTPUT ? on: April 06, 2013, 10:43:44 pm
Never mind, it was not obvious that physical pins 28,27 are actually IDE pins 19, 18
2  Using Arduino / Programming Questions / Can I set pins 27, 28 to digital INPUT OUTPUT ? on: April 06, 2013, 10:22:56 pm
Having troubles settings 27, 28 to digital INPUT OUTPUT. I want to attach ultrasound sensor, but it just doesnt work.

Code:

int dypOutputPin = 28; // TRIG
int dypInputPin = 27;  // ECHO

....

void setup() {
  pinMode(dypOutputPin, OUTPUT);
  pinMode(dypInputPin, INPUT);
}

void loop() {

  //scan forward USS (ultrasonic sensor)
  digitalWrite(dypOutputPin, LOW);
  delayMicroseconds(2);
  digitalWrite(dypOutputPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(dypOutputPin, LOW);  
  // the distance is proportional to the time interval
  // between HIGH and LOW
  distance = pulseIn(dypInputPin, HIGH,50);
  cm = distance/58;  
  
  Serial.println(cm);
  delay(50);
}



Arduino UNO R3
3  Topics / Robotics / Re: Dagu Rover 5 chassis robot demo on: February 27, 2013, 08:06:08 pm
Thank Nick you for the sample sketch!

I've manage to put together a small rover based on same motor control board and Leonardo.
Only one difference I have 4WD, so I will modify it in order to handle all 4 wheels, if you don't mind.

I solve my problem with JST by just wrapping bare wire around prongs, no pretty by will work for now.
4  Topics / Robotics / Re: Dagu Rover 5 chassis robot demo on: February 27, 2013, 01:00:56 am
Another question:

Any idea what is the type of 4 white JST connectors  for motors? Got the board, trying to connect motors.
5  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 10:27:36 pm
Finally!!! I got it, apparently Prolific modules doesn't work properly with Leonardo, the very first one on the picture is Prolific as well, not FTDI.
So luckily I had one actual FTDI attached to my MultiWii controller, when I've used that one - now all works!

They actually partially working , writing data from Arduino to PC was fine! But not reading! Crazy... I have no idea why it was so messy with Prolific chip based Ser/USB breakout boards, any ideas?
6  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 09:27:15 pm
Nope... still messy, now I get something over serial, but what I send not what I receive over Serial1 (COM3), instead of 1 I receive g and so on....
When I switch Putty to work with Serial (COM8) it works perfect....(same settings just different COM port) WTH !? smiley-sad
7  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 08:46:06 pm
I think I have some breakthrough ! Apparently FTDI module I have doesn't work properly, even It use to work with other setup before ! smiley-sad
I've connected it to Prolic USB/COM adapter and data is coming through.... I was so positive module is ok
8  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 07:58:56 pm
Tried, still doesn't work here is my sketch:

Code:

int incomingByte = 0;

void setup(){
  Serial1.begin(57600);
  Serial.begin(57600);
  while (!Serial1) {  }
}

void loop()
{
  //Serial1.println(100,DEC);
    // send data only when you receive data:
    while (Serial1.available()) {
      Serial.print("Available");
      if (Serial1.available() > 0) {
              // read the incoming byte:
              incomingByte = Serial1.read();
              // say what you got:
              Serial.print("I received: ");
              Serial.println(incomingByte, DEC);
      }
    }
}

9  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 07:40:08 pm
Sure, here is my current sketch:

Code:
int incomingByte = 0;

void setup(){
  Serial1.begin(57600);
  Serial.begin(57600);
}

void loop()
{
  //Serial1.println(100,DEC);
    // send data only when you receive data:
    while (Serial1.available()) {
      Serial.print("Available");
      if (Serial1.available() > 0) {
              // read the incoming byte:
              incomingByte = Serial1.read();
              // say what you got:
              Serial.print("I received: ");
              Serial.println(incomingByte, DEC);
      }
    }
}


Swapping RX-TX on Leonardo (0<->1) doesn't help
But when I detach RX-TX  and send characters over to COM9 (FTDI) I see it blinks, if I attach them to Leonardo, and reboot, nothing blinks when I send characters.
10  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 06:31:15 pm
Just connected 5V, doesn't help any way... which is expected.
11  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 06:19:00 pm
I use Putty, settings are 57600, 8, 1, N
Local echo turned on.
FTDI has 5 pins:
3.3V GND RX TX 5V

FTDI RX goes to PIN1 (TX)
FTDI TX goes to PIN0 (RX)

Can someone post me an example where I can read data from Serial1 and print it in Serial, Read data from Serial and print it in Serial1 ? This essentially what I need, just need to run some logic in between....
12  Using Arduino / Programming Questions / Re: Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 01:04:44 pm
Alright, here is the setup - super simple:

https://www.dropbox.com/s/bogzbc2v3j91rvl/IMG_00000002.jpg

FTDI breakout on picture connected to PC... it has 2 light green, yellow. and acts as  serial port. PC is just for debugging, it will be connected to some other devices via SERIALUSB.
13  Using Arduino / Programming Questions / Arduino Leonardo troubles reading from Serial1 on: February 25, 2013, 02:29:43 am
I having troubles with Arduino Leonardo when reading from Serial1

Here is my super simple code:

Code:
int incomingByte = 0;

void setup(){
  Serial1.begin(57600);
}

void loop()
{
    // send data only when you receive data:
    while (Serial1.available()) {
      Serial.print("Available");
      if (Serial1.available() > 0) {
              // read the incoming byte:
              incomingByte = Serial1.read();
  
              // say what you got:
              Serial.print("I received: ");
              Serial.println(incomingByte, DEC);
      }
    }
}

When I write from PC I dont see any activity on FTDI LEDs (green, yellow)

Interesting thing is: when I skip Serial1.begin(57600); I see blinking light (yellow) on FTDI board conected to PIN 0/1, when I send data from PC

But when I run:

Code:
int incomingByte = 0;

void setup(){
  Serial1.begin(57600);
}

void loop()
{
  Serial1.println(100,DEC);
    // send data only when you receive data:
    while (Serial1.available()) {
      Serial.print("Available");
      if (Serial1.available() > 0) {
              // read the incoming byte:
              incomingByte = Serial1.read();
  
              // say what you got:
              Serial.print("I received: ");
              Serial.println(incomingByte, DEC);
      }
    }
}

I see green light on FTDI working all the time, and when I write on other side  (PC) yellow LED on FTDI blinks, but I receive some messy data, even if I write same thing all the time....

Please advise.

I just want to read and write completely independently.
14  Using Arduino / Programming Questions / IS it possible to use KINECT directly with ARDUINO DUE ? on: January 20, 2013, 10:46:31 pm
IS it possible to use KINECT directly with ARDUINO DUE ? I'm curious if it have enough processing power and if anyone already done that ?
15  Topics / Robotics / Re: Dagu Rover 5 chassis robot demo on: January 19, 2013, 11:56:54 am
I would like to know if this Motor driver board will work with Arduino Due ?  ( 3.3V  Due)
Pages: [1] 2