Show Posts
Pages: 1 2 3 [4] 5 6 ... 32
46  Products / Arduino Due / Re: Trouble interfacing servo to Arduino Due on: March 04, 2014, 09:39:59 am
Hello AB08,

Could you tell us which servo you are using? How are you connecting the servo with Due? Are you using a servo shield?
DUE is tolerant to 3.3V. Most of the servos work with higher voltages (4.8-6). It is very important to consider voltage and current operation of your servo before connect it to DUE to avoid damage it. Also read the manufacturer's specs.
Some servos needs specific outputs to drive their clockwise, counter clockwise and stop functions.

regards
47  Products / Arduino Due / Re: Building a CAN API for Arduino DUE on: March 03, 2014, 10:38:31 pm
One crucial question for me: is there any quick way of determining if the frame in a mailbox has already been read? CAN.mailbox_read(0, &canframe) doesn't seem to clear the mailbox.

Hello MarkOne,

The mailbox_get_status function checks the status of the mailbox and it can be used in conjunction with a mailbox status register (CAN_MSR_MRDY) to determine whether a mailbox has received a data frame. For example, the mailbox 4 of the CAN controller 2 receives data when the following condition is TRUE:

Quote
CAN2.mailbox_get_status(4) & CAN_MSR_MRDY

I borrowed the above condition from the CANX_Handler of the original Atmel ASF CAN library.

Also, the function mailbox_int_handler will handle a mailbox interrupt but, I've not try that yet.

Regards, Palliser
48  Products / Arduino Due / Re: is it possible to get a keyboard input and pass it to a PC running win 7 or 8 on: March 01, 2014, 08:05:22 am
Hola hola123,

Arduino DUE has USB host behavior (native USB port). The IDE has a library and example to read a USB keyboard.
I am not sure if the library handle the functions you need but it could help you to start.
File->Example->USBHost->KeyboradController.

You also shall need a OTG cable to connect the keyboard with the DUE. You can also share what exactly you are pursuing
or an example of your application.

Regards,
Palliser
49  Topics / Science and Measurement / Measuring time lapses on: February 27, 2014, 11:49:47 pm
The following code allows for the measurement of the time interval in milliseconds between two button pressing (without debouncing).

Code:
const int buttonPin = 2;
unsigned long buttonTimer, timeInterval;
boolean counting = false;

void setup ()
  {
    Serial.begin(9600);
  }

void loop ()
  {
    if (digitalRead (buttonPin) == HIGH && counting ==  false)
    {
     Serial.println("Start lapse...");
     buttonTimer = millis ();
     counting = true;
     delay(200);
    }
   
    if (digitalRead (buttonPin) == HIGH && counting ==  true)
    {
      timeInterval = millis () - buttonTimer;
      Serial.print("Stop. Time elapsed: ");
      Serial.print(timeInterval);
      Serial.println(" msec");
      counting = false;
      delay(200);
    }
}

I used the same circuit from the Arduino debounce tutorial
http://arduino.cc/en/Tutorial/Debounce#.UxAUDvldWSo

Regards, Palliser
50  Products / Arduino Due / Re: Arduino Due and 1602 LCD keypad shield modification on: February 21, 2014, 04:24:29 pm
i was thinking of using this part

https://www.sparkfun.com/products/9052

-phil


Hi Phil,
I think that should be a right choice (3.3V and HD44780). I must say that so far I have not used DUE with an LCD.
May be someone here in the forum could tell us about it.
-P
 
51  Products / Arduino Due / Re: Arduino Due and 1602 LCD keypad shield modification on: February 21, 2014, 02:32:11 pm
Do you think I can take the Sain smart board and pull the TC1602 and replaced it with a HD44780 from sparkfun electronics?

I don't see how you can do that. AFAIK, most of the 1602s are glued (epoxied) directly onto the board and for sure both prints (TC1602 and HD44780) will not match. I'd rather recommend you to get a new 3.3v LCD board.
Palliser
 
52  Products / Arduino Due / Re: Arduino Due Dac configuration on: February 21, 2014, 12:59:38 pm
As a reference, here a BareMinimum sketch that generates a decent 1.4kHz sinewave (120 samples) using DUE's DAC1.

Code:
int i = 0;
void setup() {
  analogWriteResolution(12);
}

static int sine[] = {
    0x7ff, 0x86a, 0x8d5, 0x93f, 0x9a9, 0xa11, 0xa78, 0xadd, 0xb40, 0xba1,
    0xbff, 0xc5a, 0xcb2, 0xd08, 0xd59, 0xda7, 0xdf1, 0xe36, 0xe77, 0xeb4,
    0xeec, 0xf1f, 0xf4d, 0xf77, 0xf9a, 0xfb9, 0xfd2, 0xfe5, 0xff3, 0xffc,
    0xfff, 0xffc, 0xff3, 0xfe5, 0xfd2, 0xfb9, 0xf9a, 0xf77, 0xf4d, 0xf1f,
    0xeec, 0xeb4, 0xe77, 0xe36, 0xdf1, 0xda7, 0xd59, 0xd08, 0xcb2, 0xc5a,
    0xbff, 0xba1, 0xb40, 0xadd, 0xa78, 0xa11, 0x9a9, 0x93f, 0x8d5, 0x86a,
    0x7ff, 0x794, 0x729, 0x6bf, 0x655, 0x5ed, 0x586, 0x521, 0x4be, 0x45d,
    0x3ff, 0x3a4, 0x34c, 0x2f6, 0x2a5, 0x257, 0x20d, 0x1c8, 0x187, 0x14a,
    0x112, 0xdf, 0xb1, 0x87, 0x64, 0x45, 0x2c, 0x19, 0xb, 0x2,
    0x0, 0x2, 0xb, 0x19, 0x2c, 0x45, 0x64, 0x87, 0xb1, 0xdf,
    0x112, 0x14a, 0x187, 0x1c8, 0x20d, 0x257, 0x2a5, 0x2f6, 0x34c, 0x3a4,
    0x3ff, 0x45d, 0x4be, 0x521, 0x586, 0x5ed, 0x655, 0x6bf, 0x729, 0x794
};

void loop() {
  analogWrite(DAC1, sine[i]);
  i++;
  if(i == 120)
    i = 0;
}

Regards, palliser
53  Products / Arduino Due / Re: Arduino Due and 1602 LCD keypad shield modification on: February 20, 2014, 05:32:58 pm
Hello weightwatcherphil,

I think your problem lies in your LCDKeypad shield itself. Why? The minimum VDD for logic in the TC1602 is 4.8V, thus with 3.3V it will not work. May be your solutions are either to replace your shield for a 3.3V or to use a logic level converter like:
https://www.sparkfun.com/products/11978 or so.

Regards,
Palliser
54  Products / Arduino Due / Re: Arduino Due on: February 20, 2014, 05:02:39 pm
Is this indicating I hook the speakers up to DAC0 and 1 or do I need to hook them to DAC0,1, and GND, or what?

Hello xaviorbat,
Before you frytry any of your Due's DAC outputs, please, read first the following post.

http://forum.arduino.cc/index.php?topic=139733.15

Regards, Palliser.

55  Products / Arduino Due / Re: TX and RX not working with the SoftwareSerial library with Arduino Due (serLCD) on: February 20, 2014, 04:50:15 pm
maksudcan,

I assume from your description that you have a Sparkfun model LCD-09066, then, let's start trying to make your LCD to work, for example, with Serial1 on DUE. For that you just need to connect your LCD as the following picture:



Quote
Note from Sparkfun:
"Though the silkscreen may say '5V', this is a 3.3v Serial LCD. Connect to a 3.3v power source".

Tweaking a bit the sample1 from Sparkfun, try the following sketch:

Code:
void setup()
{
  Serial1.begin(9600); // set up serial port for 9600 baud
  delay(500); // wait for display to boot up
}

void loop()
{
  Serial1.write(254); // move cursor to beginning of first line
  Serial1.write(128);

  Serial1.write("                "); // clear display
  Serial1.write("                ");

  Serial1.write(254); // move cursor to beginning of first line
  Serial1.write(128);
 
  Serial1.write("Hello, world!");

  while(1); // wait forever
}

Good luck!
56  Products / Arduino Due / Re: TX and RX not working with the SoftwareSerial library with Arduino Due (serLCD) on: February 20, 2014, 03:26:34 pm
I googled for "Sparkfun serial enabled LCD screen" and the Sparkfun website shows a dozen of LCDs. Most of them require 5V TTL serial (DUE works with 3.3V). Which one you are using? LCD-??????

Also, SoftwareSerial is a good 'crutch' AVR serial library (not intended for DUE) and Mark is right. DUE doesn't need SoftwareSerial given its 4 serial ports (like Mega).

Regards, Palliser.
57  Products / Arduino Due / Re: Error while trying to use scheduler.startLoop in scheduler library ardiuno DUE on: February 20, 2014, 02:43:50 pm
Hello alibaba9292,

Wprogram.h? I am not sure but it seems to me that you are using the Arduino Schedule library for AVR.
http://playground.arduino.cc/Code/Scheduler

This library is not intended for Arduino DUE (SAM based).

The IDE 1.5.x has its own scheduler library. Why not try the MultipleBlinks example as a start point?.
File->Examples->Scheduler

Regards, Palliser
58  Products / Arduino Due / Re: No SPI in 1.5.5 ? on: February 20, 2014, 02:17:18 pm
Hi VolDel,
Arduino DUE has a buit-in Ethernet controller (EMAC). I've started a post of a library development but using a third-party DUE board given the degree of access to the Ethernet pins in the original DUE. So far, I have a raw library (ported from Atmel) with a simple web-server sketch that runs OK. I hope to resume the post soon and move on with an oriented Arduino Ethernet library and a couple of sample sketches. If you are interested, here the link (look a my reply #92).

http://forum.arduino.cc/index.php?topic=142908.90

Regards, Palliser
59  Products / Arduino Due / Re: No SPI in 1.5.5 ? on: February 20, 2014, 11:36:21 am
Hello VolDel,

Each Arduino IDE 1.5.x has SPI library with a couple of examples.

Quote
File->example->SPI->BarometricPressureSensor
                                 DigitalPotControl

Files location:
Quote
...\arduino-1.5.5-r2-windows\arduino-1.5.5-r2\hardware\arduino\sam\libraries\SPI

Indeed, Due SPI library has an Extended functionality that exploits the SAM3X8E core allowing features like:
- Automatic handling of the device slave selection.
- Automatic handling of different device configurations.

More information here:
http://arduino.cc/en/Reference/DueExtendedSPI#.UwYvuvldWSo

Look at Graynomad Due pinout diagram for details on the SPI connection.
http://forum.arduino.cc/index.php?topic=132130.0

You can play with or modify them according to your needs.
By the way, what SPI device you need to connect to DUE? LCD? SD reader?

Regards, Palliser
60  Products / Arduino Due / Re: analogWrite freezes the board on: February 19, 2014, 05:52:04 pm
Hello jdorval,
Which IDE version you are using? 1.5.5-r2 or older?
Also, could you run the following code to see if the built-in led L (amber) fades?

Code:
const int ledPin = 13;

void setup() {
  pinMode(ledPin, OUTPUT); }

void loop() {
  for (int brightness = 0; brightness < 255; brightness++) {
    analogWrite(ledPin, brightness);
    delay(2);
  }
  for (int brightness = 255; brightness >= 0; brightness--) {
    analogWrite(ledPin, brightness);
    delay(2);
  }
  delay(100);
}

Regards,
Palliser
Pages: 1 2 3 [4] 5 6 ... 32