Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Sensors / Re: Need circuit interfacing t...
Last post by knut_ny - Today at 03:04 pm
.. the 'speciel' component cam be LM231/LM331
12
Arduino Due / Re: Powering 5v modules with t...
Last post by didou - Today at 03:04 pm
Hi,

It depends on wether the module properly works if powered with 3.3v. If so, just power it with the 3.3v pin of the Arduino.
If not, things get more subtle. If the module outputs a signal based on its Vcc, then you must not directly use the 5v pin, otherwise the signal you will input in return of the module will exceed the 3.3v accepted by the Due.
I had the same issue with an accelerator module. I bought a level converter (e.g. http://www.banggood.com/Logic-Level-Converter-Bi-Directional-IIC-4-Way-Level-Conversion-Module-p-938774.html)
With such a module, you safely convert 5v <-> 3.3v. Of course, the drawback is that you have more wires  :(

I do not know if there is some other solutions.
Best,
13
Arduino Yún / Re: Streaming energy consumpti...
Last post by ShapeShifter - Today at 03:02 pm
I think I have to rerun the run.py file.
If that is something you had to start manually from the command line, then yes, you will have to rerun it each time you reset or cycle power.

There are at least two ways to automate this:
  • Add a command to rc.local on the Linux side.
  • Add an asynchronous process can to the setup() function of your sketch.

For option 1, at the Linux command line, edit /etc/rc.local, and add the run.py command. Or, log into your Yun's web interface, go to the advanced configuration pages, select the System tab then the Startup tab. There you will see an edit box that lets you modify rc.local.

For option 2, use the Process class to define a process object with the required run.py command, then that process object's runAsynchronously() function to start the process.
14
Deutsch / Kompass Projekt - Overflow Pro...
Last post by MultiStorm - Today at 03:01 pm
Hallo,
ich habe aktuell ein kleines Problem

Ich arbeite an einem TFT Kompass was eigentlich super Funktioniert ....
Es könnte zwar etwas schneller sein aber ein Problem nach dem Anderen ...

Wenn der Gradwert auf >100° Steigt startet das Arduino UNO neu .... solange der wert unter 100 liegt funktioniert alles Perfekt ....

Hier erstmal der Code:

Code: [Select]

#include <HMC5883L.h>
#include <Wire.h>

#define cx 45  //64
#define cy 80  //80
#define cr 30  //45
#define cb 5

HMC5883L compass;
int error = 0;

float heading_degrees = 0;
float heading_degrees_old = 360;

void InitCompass()
{
  Wire.begin(); // Start the I2C interface.
  compass = HMC5883L(); // Construct a new HMC5883 compass.
  error = compass.SetScale(1.3); // Set the scale of the compass.
  //if(error != 0) // If there is an error, print it out.
  error = compass.SetMeasurementMode(Measurement_Continuous); // Set the measurement mode to Continuous
}

void DrawCompass()
{
  screen.stroke(255,255,255);
  screen.fill(0,0,0);
  screen.circle(cx,cy,cr+1);
  screen.circle(cx,cy,cr-1);
  screen.circle(cx,cy,cr);
}

void DrawNSEW()
{
  screen.stroke(0,0,255);
  screen.setTextSize(1);
  screen.text("N", 45, 40);
  screen.stroke(255,255,255);
  screen.text("S", 45, 115);
  screen.text("W", 5, 77);
  screen.text("E", 80, 77);
}

void DrawDegreeValue()
{
  char degreeCharValue[6];
  dtostrf(heading_degrees, sizeof(heading_degrees),2,degreeCharValue);
 
  screen.stroke(0,0,0);
  screen.fill(0,0,0);
  screen.rect(85,100,75,17);
 
  screen.stroke(255,255,255);
  screen.setTextSize(2);
  screen.text(degreeCharValue, 85, 100);
}

void GetDegrees()
{
  MagnetometerRaw raw = compass.ReadRawAxis();
  MagnetometerScaled scaled = compass.ReadScaledAxis();
 
  int MilliGauss_OnThe_XAxis = scaled.XAxis;// (or YAxis, or ZAxis)
  float heading = atan2(scaled.YAxis, scaled.XAxis);
  float declinationAngle = 0.0457;
  heading += declinationAngle;
 
  if(heading < 0)
    heading += 2*PI;
   
  if(heading > 2*PI)
    heading -= 2*PI;
   
  heading_degrees = heading * 180/M_PI;
 
  if(heading_degrees<0)heading_degrees+=360;
  if(heading_degrees>=360)heading_degrees-=360;
 
  if(heading_degrees!=heading_degrees_old)
  {
    DrawDegreeValue();
    //DrawCompassNeedle();
    //heading_degrees_old = heading_degrees;
  }
}

void DrawCompassNeedle()
{
  int m = 0;
  int h = heading_degrees_old + 90;
  screen.stroke(0,0,0);
  screen.line((int)cx,(int)cy,(int)(cx+(cr-4)*cos(M_PI/180*h)),(int)(cy-(cr-4)*sin(M_PI/180*h)));
  h= heading_degrees + 90;
  screen.stroke(255,0,0);
  screen.line((int)cx,(int)cy,(int)(cx+(cr-4)*cos(M_PI/180*h)),(int)(cy-(cr-4)*sin(M_PI/180*h)));
}


Ich konnte das Problem auf 2 Methoden eingrenzen
bzw. auf 2 Zeilen die Methode DrawCompassNeedle und das zuweisen des Wertes zur Puffer Variable
heading_degrees_old .. beide Zeilen Führen zum Fehler ... Dienzuweiseung zu heading_degrees_old
Führt zum Neustart des Bords ..

Kommentiere ich diese aus Start das Bord zwar nicht neu Aber friert bei über 100° ein 
nehme ich beide Zeilen aus dem Code Funktioniert alles Perfekt !

Code: [Select]

    //DrawCompassNeedle();
    //heading_degrees_old = heading_degrees;


Habt ihr eine Idee was da los ist ?

Hier noch der Restliche Code:

Quote
#include <SPI.h>
#include <TFT.h>            // Arduino TFT library
#include <OneWire.h>

#define cs   10
#define dc   9
#define rst  8

TFT screen = TFT(cs, dc, rst);
OneWire  ds(2);  // on pin 10 (a 4.7K resistor is necessary)

void setup() {
  screen.begin();
  Serial.begin(9600);
  screen.background(0,0,0);
  screen.stroke(255,255,255);
  PaintBattery(0);
  WriteTempToDisplay();
  DrawCompass();
  DrawNSEW();
  InitCompass();
  DrawDegreeValue();
}

void loop()
{
  //screen.background(0,0,0);
  WriteTempToDisplay();
  PaintBattery(100);
  GetDegrees();
}
Habt ihr eine idee ich bin langsam echt Ratlos !=?!?!?!

Danke schon mal im Vorraus!
15
Software / Re: Registro de la hora desde ...
Last post by carmeloco - Today at 03:00 pm
A mi me funciona perfectamente. Creo que, tienes algún problema, o con el módulo SD (mira bien la alimentación, ya que si no lleva regulador, hay que alimentarlo a 3,3V) o con la tarjeta SD. Prueba otra tarjeta, a ver si hay algún problema de incompatibilidad con esa.

Te muestro mis resultados por puerto serie:

Code: [Select]
Reloj RTC1307 corriendo!
Tarjeta inicializada.
2015/4/26 14:52:37 - watts/m2 - p1= 0 - p2= 0 - p3= 0
2015/4/26 14:52:38 - watts/m2 - p1= 1643 - p2= 1669 - p3= 1766
2015/4/26 14:52:39 - watts/m2 - p1= 1587 - p2= 1534 - p3= 1584
2015/4/26 14:52:40 - watts/m2 - p1= 1440 - p2= 1364 - p3= 1432
2015/4/26 14:52:41 - watts/m2 - p1= 1467 - p2= 1396 - p3= 1440
2015/4/26 14:52:42 - watts/m2 - p1= 1698 - p2= 1666 - p3= 1652
2015/4/26 14:52:43 - watts/m2 - p1= 1772 - p2= 1754 - p3= 1728
2015/4/26 14:52:44 - watts/m2 - p1= 1772 - p2= 1766 - p3= 1751
2015/4/26 14:52:45 - watts/m2 - p1= 1690 - p2= 1672 - p3= 1678
2015/4/26 14:52:46 - watts/m2 - p1= 1710 - p2= 1693 - p3= 1696
2015/4/26 14:52:47 - watts/m2 - p1= 2074 - p2= 2003 - p3= 2006
2015/4/26 14:52:48 - watts/m2 - p1= 2379 - p2= 2185 - p3= 2270
2015/4/26 14:52:49 - watts/m2 - p1= 2367 - p2= 2174 - p3= 2261


Y lo grabado en la SD:

Code: [Select]
2015/4/26 14:52:37 - watts/m2 - p1= 0 - p2= 0 - p3= 0
2015/4/26 14:52:38 - watts/m2 - p1= 1643 - p2= 1669 - p3= 1766
2015/4/26 14:52:39 - watts/m2 - p1= 1587 - p2= 1534 - p3= 1584
2015/4/26 14:52:40 - watts/m2 - p1= 1440 - p2= 1364 - p3= 1432
2015/4/26 14:52:41 - watts/m2 - p1= 1467 - p2= 1396 - p3= 1440
2015/4/26 14:52:42 - watts/m2 - p1= 1698 - p2= 1666 - p3= 1652
2015/4/26 14:52:43 - watts/m2 - p1= 1772 - p2= 1754 - p3= 1728
2015/4/26 14:52:44 - watts/m2 - p1= 1772 - p2= 1766 - p3= 1751
2015/4/26 14:52:45 - watts/m2 - p1= 1690 - p2= 1672 - p3= 1678
2015/4/26 14:52:46 - watts/m2 - p1= 1710 - p2= 1693 - p3= 1696
2015/4/26 14:52:47 - watts/m2 - p1= 2074 - p2= 2003 - p3= 2006
2015/4/26 14:52:48 - watts/m2 - p1= 2379 - p2= 2185 - p3= 2270
2015/4/26 14:52:49 - watts/m2 - p1= 2367 - p2= 2174 - p3= 2261


Los valores de los sensores no son correctos, porque no tengo nada conectado a las entradas analógicas.
16
Website and Forum / Re: Typo
Last post by bobdabiulder - Today at 02:57 pm
Under what category should it go?  Snippets and Sketches for Arduino?
17
Français / Problème lecture entrée MCP342...
Last post by Hexor - Today at 02:56 pm
[Je remet le topic ici, ça évitera de polluer celui de B@tto, et il a surement plus ça place ici que dans "Réalisations et Projets Finis"]

Bonjour B@tto,

Tout d'abord merci pour cette librairie !

Je rencontre un petit soucis (qui vient surement de moi !)

J'utilise un MCP3424 + 4 jauges Fx1901 + ta librairie.
J'utilise donc ton exemple qui balaye les 4 entrée.
Tout marche bien pour la 1ere vague de lecture, par contre après toutes les valeur correspondent à la lecture de la 4ème entrée de la 1ere vague de lecture  :o
Et donc si je reset l'Arduino, la 1ere vague de lecture est bonne et après....

Code: [Select]
Channel 1 : 390 microVolt
Channel 2 : 125 microVolt
Channel 3 : -906 microVolt
Channel 4 : 7859 microVolt
Channel 1 : 7859 microVolt
Channel 2 : 7859 microVolt
Channel 3 : 7859 microVolt
Channel 4 : 7859 microVolt
Channel 1 : 7859 microVolt
Channel 2 : 7859 microVolt
Channel 3 : 7859 microVolt
Channel 4 : 7859 microVolt
Channel 1 : 7859 microVolt
Channel 2 : 7859 microVolt
Channel 3 : 7859 microVolt
Channel 4 : 7859 microVolt
...


Voici le code utilisé (le digitalWrite sert à activer l'alim du MCP3424):
Code: [Select]

/* MCP 3424 version 1.2 example sketch Multichannel
Written by B@tto
Contact : batto@hotmail.fr

In this example, the four channel are measured and results displayed by serail connection.
*/

#include <MCP3424.h>
#include <Wire.h>

MCP3424 MCP(0); // Declaration of MCP3424 pin addr1 et addr0 are connected to +5V

long Voltage[4]; // Array used to store results

void setup() {
  pinMode(5, OUTPUT);
  digitalWrite(5, HIGH);
  delay(1000);
  Serial.begin(9600);  // start serial for output

}

void loop(){

  for(int i=1;i<=4;i++){

    MCP.Configuration(i,18,1,1); // MCP3424 is configured to channel i with 18 bits resolution, continous mode and gain defined to 8
    Voltage[i]=MCP.Measure(); // Measure is stocked in array Voltage, note that the library will wait for a completed conversion that takes around 200 ms@18bits
    Serial.print("Channel "); // print results
    Serial.print(i);
    Serial.print(" : "); 
    Serial.print(Voltage[i]);
    Serial.println(" microVolt");

  }
 
  delay(500);
}


Quelqu'un à une idée svp ?
Merci  :D
18
Hardware / Re: [OT] comprare nuovo saldat...
Last post by astrobeed - Today at 02:56 pm
Astro, la tua AOYUE e' di quelle con il saldatore "a stilo corto" ? (intendo, minima distanza fra il punto piu avanzato dell'impugnatura e la punta) ...
Stilo medio, ne lungo ne corto.

Quote
Seriamente, che mi dici sulla durata di quelle punte ? ... e sul loro trasferimento termico ? ... sono buone ?
Le punte di Ayouoe sono buone, è possibile usare le punte Hakko, che sono ottime, in quanto l'attacco è lo stesso.
Quantificare la durata è difficile perché non uso il saldatore tutti i giorni, però negli ultimi due anni ho cambiato solo una punta perché mi cascato lo stilo e si è piegata.
19
Project Guidance / Re: Connecting LCD keypad Shie...
Last post by jurs - Today at 02:55 pm
If I want to print a other message then Sensor ERROR, where do I need to change it? If I change sensor ERROR, its not displaying anything.
If you want to display a different message instead, copy a different message into to string buffer variable 'buf'.

For example you can change from:
Code: [Select]

if (distance<0)
      strcpy(buf,"Sensor ERROR");

to:
Code: [Select]

if (distance<0)
      strcpy(buf,"***ERROR***");


What's the problem?
20
Thanks for the replies,

I would prefer to make the process repeat every 72 hours in cycle. The count can start after Arduiino restart. Of course this will make problem in case that power supply is off by some general reason and the plant watering time will be restarted. But for now maybe basic 72 hours code not related to the day of the month will work fine.

Pages: 1 [2] 3 4 ... 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