Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
OK I found the solution myself. When I was logged in as admin, I thought I can skip the sudo command and run the nvram command directly. I was wrong. I had to use sudo nvram. This is probably a protection so an admin doesn't accidentaly shoots himself by the foot when typing in a dangerous command by mistake.
22
Update-
 While the initial design did do the job once set up properly, it had its drawbacks.  Namely, it required way too many pieces to hold the servo in the right position, and even then it required constant adjustment to get the proper motion.
 A much better approach was suggested to me by a friend who had a baby the same week as I did...  Instead of attaching the rocker to a chord controlled by an exterior-mounted servo, he suggested mounting a continuous rotation servo on the rocker itself with either a cam shape, or single arm propelling the rocker forward on each rotation.
 I can post photos later, but the result is a much simpler setup with a far more consistent motion.  There is one significant drawback however...  With the first setup, the sound of the back and forth motion created just the right amount of white noise to put my son to sleep.  The continuous rotation servo OTOH emanates a high pitched whine of the type that signals distress or strain in both the animal and mechanical world alike!  As for my purposes, the continuous rotation servo is really just a geared dc motor in a hobby form factor, I wonder if I could replace it with a different motor that would produce less noise?  Or at least, one that doesn't sound so grating?
23
Displays / Re: Info on 3.2" TFT labeled "...
Last post by ghlawrence2000 - Today at 06:34 pm
Hi Kurt,

Welcome to the forums!  :D Apologies for the delay in answering your question.

The libraries you are looking for are UTFT by Henning Karlsen, his web site has all of the libraries necessary to make your display work, including touch. http://www.rinkydinkelectronics.com/library.php?id=51

If you are having problems with the wiring, you should probably buy a TFT shield, these are available for Due or Mega from various stores, but I would recommend Coldtears on ebay, here.http://stores.ebay.com/coldtears-electronics-store/TFT-LCD-Modules-/_i.html?_fsub=3830141016&_sid=680237586&_trksid=p4634.c0.m322

Regards,

Graham

24
Microcontrollers / Re: STM32, Maple and Maple min...
Last post by madias - Today at 06:34 pm
@victor: Thank you for your library! Works great and extreme fast!
Note to all: Download link is on victors github account:
https://github.com/victorpv
You have also to use victors SPI library!
25
Arduino Due / DueTimer and readBytes interru...
Last post by fiso - Today at 06:34 pm
Hello,

I have two arduinos due communicating together over bluetooth using HC5 module. One device (let's call it secondary) is trasmitting data all the time in the loop():

Code: [Select]

loop() {
  Serial2.print( block-of-data );
}


The other device (primary) is receiving data:
Code: [Select]

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial2.begin(115200);
  Serial2.setTimeout(1);
  Serial.println("hello");
}

void loop() {
  Serial.println("int");
  byte packet[32];
  if(Serial2.readBytes(packet, 32) == 0) {
    Serial.println("timeout");
  } else {
    Serial.println("received");
  }
}


This code works. If the secondary stops trasmitting data, timeout is printed. When I use the DueTimer library with following

Code: [Select]

#include "DueTimer.h"

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial2.begin(115200);
  Serial2.setTimeout(1);
  Serial.println("hello");
  Timer.getAvailable().attachInterrupt(readData).setPeriod(1000000).start();
}

void readData() {
  Serial.println("int");
  byte packet[32];
  if(Serial2.readBytes(packet, 32) == 0) {
    Serial.println("timeout");
  } else {
    Serial.println("received");
  }
}


void loop() {
  // put your main code here, to run repeatedly:
}

it can receive data, but when the secondary stops to trasmit, instead of "timeout" the readBytes is blocked and does not release after the timeout is reached.

What I have tried is to implement the readBytes on my own with Serial.available and measuring the timeout using micros(). For some reason micros kept on giving repeated values and it wasn't incrementing properly. As far as I know, the internal micros() and millis() timers are based on Timer0 or Timer1, and therefore the attached interrupt should not interfere with the time measurements.

Does someone have greater insight into this to solve this problem?
26
Deutsch / Re: Einsteiger: Problem mit de...
Last post by DennisDerEben - Today at 06:33 pm
Naja ich habe die Ganze sache immer wieder überschrieben und jetzt gerade kam nur noch Kernschrott bei raus.
Ich habe es versucht mit einem Counter zu regeln...
Auf der Grundlage dieses Beispieles wollte ich es anfertigen. Also noch einen weiteren buttonPin hinzufügen.
hab leichte veränderungen daran vorgenommen, da es ursprünglich dafür gedacht war, die LED aufleuchten zu lassen, wenn man 4x den Taster betätigt hat.
bei mir ist es jetzt so verändert, das man wenn man den Taster betätigt, die Led an geht und nach dem lösen des Tasters wieder erlischt.
Aber alles nur rumprobiere und bitte gebt dem keinen Anspruch auf Richtigkeit :P


Code: [Select]


const int  buttonPin = 2;    // the pin that the pushbutton is attached to
const int ledPin = 13;       // the pin that the LED is attached to

// Variables will change:
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin, INPUT);
  // initialize the LED as an output:
  pinMode(ledPin, OUTPUT);
  // initialize serial communication:
  Serial.begin(9600);
}


void loop() {
  // read the pushbutton input pin:
  buttonState = digitalRead(buttonPin);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:
      buttonPushCounter++;
      Serial.println("on");
      Serial.print("number of button pushes:  ");
      Serial.println(buttonPushCounter);
    }
    else {
      // if the current state is LOW then the button
      // wend from on to off:
      buttonPushCounter--;
      Serial.println("off");
      Serial.print("aktueller Wert:  ");
      Serial.println(buttonPushCounter);
    }
  }
  // save the current state as the last state,
  //for next time through the loop
  lastButtonState = buttonPushCounter;

 
  // turns on the LED every four button pushes by
  // checking the modulo of the button push counter.
  // the modulo function gives you the remainder of
  // the division of two numbers:
  if (buttonPushCounter == 0) {
    digitalWrite(ledPin, HIGH);
  } else {
   digitalWrite(ledPin, LOW);
  }
 
}


27
Okay, Im not really sure what you mean, do you mean this line 'value=new String(data);' should be out of the receive function?
Also should it be a string? As it is receiving numbers?

Just to save time, the next step for me is to also include the sensor number and the sequence number; how do I just add line for each one like this:

Udp.print(mapped);
Udp.print(sensor_1);
Udp.print(sequence_number);

Also im not really sure what the sequence number is? How are these separated on the other side?

(sorry for the barrage of questions)
28
Sensors / Re: Low pass filter
Last post by knut_ny - Today at 06:33 pm
If the noise triggers at random times, a filter will not help. You will have to make your circuit more immune to noise

29
Installation & Troubleshooting / Re: error port COM
Last post by Terakon - Today at 06:32 pm
have you instaled correct driver on the new PC ?
see you in device manager leonardo on port?
30
According to your other thread, thie Arduino part is working. It is your display in the processing code that is not working.
Pages: 1 2 [3] 4 5 ... 10

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy