Recent Posts

Pages: [1] 2 3 ... 10
1
Thanks for your answer.

I can give details if needed, not sure what to say though.

Anyway, if you think this is pointless, fair enough, I'll try something. Perhaps it's too early in the project to think about this.

Cheers
2
Programming Questions / Re: Servo to Motor
Last post by Delta_G - Today at 11:55 pm
So what I need to change in the code?

Start by reading the forum guidelines on how to post code and how to ask a good question.  Then come back and fix your post to include code tags and all the relevant details about your project that someone might need in order to help you.

I mean, don't you think you should at least mention what kind of motor you want to control?  Would you be happy if we gave you code for the wrong type of motor?
3
Sensors / LPS25H pressure sensor
Last post by MarcinDyba - Today at 11:55 pm
Hi Everybody,

I am new on this forum , but have some experience with arduino.

Recently I decided to build some kind of variometer for my RC plane based on arduino uno+LPS25H. Unfortunately,  this sensor in default settings has poor accuracy and vario in that condition does not make sense - error is approx +-1m.

In order to improve accurancy I have to turn on FIFO mode , but to do this I have to change register according to decryption "The FIFO buffer is enabled by setting to 1 the FIFO_EN bit (21h - CTRL_REG2)" and then select "FIFO mean mode (F_MODE2:0="110" in FIFO_CTRL (2Eh))".

According to documentation in"LPS25H.h" file I have:
 "void writeReg(int reg, byte value);"


I wrote this simply code to check register , but apparently I did something wrong , because in the results


FIFO CHECK=
32  //FIFO_EN=0x2F
0    //CTRL_REG2=0x21;
41  //FIFO_CTRL=0x2E;
 
Status&MODE after change=
32
0
110


Would be somebody so nice and help me?

Thank you in advance.

Code:
#include <Wire.h>
#include <LPS25H.h>

LPS25H ps;

//ON
int CTRL_REG2=0x21;
byte valueON = 1;

//MODE
int FIFO_CTRL=0x2E;
byte valueCH =110;

//CHECK
int FIFO_EN=0x2F;

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

  if (!ps.init())
  {
    Serial.println("Failed to autodetect pressure sensor!");
    while (1);
  }

  ps.enableDefault();
   
Serial.println("FIFO CHECK=");
Serial.println(ps.readReg(FIFO_EN));
Serial.println(ps.readReg(CTRL_REG2));
Serial.println(ps.readReg(FIFO_CTRL));
Serial.println(" ");

Serial.println("Status&MODE after change=");
ps.writeReg(CTRL_REG2,valueON);
ps.writeReg(FIFO_CTRL,valueCH);
Serial.println(ps.readReg(FIFO_EN));
Serial.println(ps.readReg(CTRL_REG2));
Serial.println(ps.readReg(FIFO_CTRL));
}


4
That did it, thanks.
5
There are lots of different types of connectors.  Which is best for you depends on a whole lot of details that you've left out.  Nobody will be able to tell you which is best from such a vague description of the project.  Certainly a google search would turn up the most common types and at least give you a place to start.
6
Displays / MD Parola displaying wrong tex...
Last post by acestu - Today at 11:52 pm
Hi

I am trying the MD Parola esp8266 LED  Matrix example but when I type lower case c's into the message box they are coming out as lower case o's , anyone know why ?


thanks in advance
Stuart
7
Quote
Is there a max length for the GND wire?
No but their are maximum lengths for signals. A signal will degrade the longer it is made to travel. It sounds like that is what is happening.

However you give very little details about this reader so I can't say much more.
8
Programming Questions / Servo to Motor
Last post by bob5731 - Today at 11:51 pm
I'm new to arduino

I found some code that work whit smartthings to control a Servo.
Now need to control a Motor not a Servo.

I have L9110S DC Stepper Motor Driver Board H Bridge By Atomic Market.
Module power supply voltage: 2.5-12 v 0.8A maximum working current.

Vent Miser motor use 1.5v.
The Vent Miser run on 2 AAA battery.

So what I need to change in the code?

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <Servo.h>

#define WLAN_SSID       " "
#define WLAN_PASS       " "

MDNSResponder mdns;
ESP8266WebServer server(80);

Servo myservo;
int pos = 0;
int state = 0;
int prevstate = 0;
int dirc = 0;
int servoPin = 5; //CHANGE TO WHATEVER PIN YOUR USING

String webPage = "";

void setup(void) {
  webPage += "<h1>ESP8266 Web Server</h1><p>Blinds <a href=\"open\"><button>OPEN</button></a>&nbsp;<a href=\"close\"><button>CLOSE</button></a></p>";

  delay(1000);
  Serial.begin(115200);
  delay(500);
  Serial.println("Blind Startup Sequence");
  delay(500);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(WLAN_SSID);
  WiFi.begin(WLAN_SSID, WLAN_PASS);
  // Set a static IP (optional)
  IPAddress ip(192, 168, 1, 170);
  IPAddress gateway(192, 168, 1, 1);
  IPAddress subnet(255, 255, 255, 0);
  WiFi.config(ip, gateway, subnet);
  // End of set a static IP (optional)
  delay(500);
  int i = 0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    ESP.wdtFeed();
    if (i > 40)                                        // Try 40 times to connect to Wifi
      Serial.print("Restarting Wifi"); ESP.reset();    // Reset Wifi stack if more than 40 trys
    i++;
    WiFi.begin(WLAN_SSID, WLAN_PASS);
    // Set a static IP retry (optional)
    IPAddress ip(192, 168, 1, 127);
    IPAddress gateway(192, 168, 1, 1);
    IPAddress subnet(255, 255, 255, 0);
    WiFi.config(ip, gateway, subnet);
    // End of set a static IP retry (optional)
  }

  Serial.println();
  Serial.println("WiFi connected");
  Serial.println("IP address: "); Serial.println(WiFi.localIP());

  if (mdns.begin("esp8266", WiFi.localIP())) {
    Serial.println("MDNS responder started");
  }

  server.on("/", []() {
    server.send(200, "text/html", webPage);
  });
  server.on("/open", []() {
    server.send(200, "text/html", webPage);
    Serial.println("HTTP OPEN COMMAND RECEIVED");
    dirc = 0;  // direction for servo to run
    state = 2; // sets current state
  });
  server.on("/close", []() {
    server.send(200, "text/html", webPage);
    Serial.println("HTTP CLOSE COMMAND RECEIVED");
    dirc = 180; // direction for servo to run
    state = 1;  // sets current state
  });
  server.begin();
  Serial.println("HTTP server started");
}

void servo_move() {
  Serial.println("State Change. Rotating Servo");
  if ( dirc == 180) {
    myservo.attach(servoPin);              // energize servo
    delay(50);
    for (pos = 0; pos <= 90; pos += 1) {   // goes from 0 degrees to 90 degrees in steps of 1 degree CHANGE 90 TO MATCH ANGLE OF TILT DESIRED
      myservo.write(pos);                  // tell servo to go to position in variable 'pos'
      delay(30);                           // waits 30ms between each degree to slow rotation speed
    }
    delay(50);
    myservo.detach();                      // movement finished so detach servo to conserve power
  }
  else if (dirc == 0) {
    myservo.attach(servoPin);              // energize servo
    delay(50);
    for (pos = 90; pos >= 0; pos -= 1) {   // goes from 90 degrees to 0 degrees in steps of 1 degree CHANGE 90 TO MIRROR ANGLE OF TILT DESIRED ABOVE
      myservo.write(pos);                  // tell servo to go to position in variable 'pos'
      delay(30);                           // waits 30ms between each degree to slow rotation speed
    }
    delay(50);
    myservo.detach();                      // movement finished so detach servo to conserve power
  }

  Serial.println("Returning to main loop");
  return;
}

void loop(void) {
  if (state != prevstate) {
    Serial.println("State change!");
    servo_move();
  }
  prevstate = state;
  server.handleClient();
}
9
To the mod who removed my post:

I see your point but why didn't you take the same action agains leee488 who wasted my time also.

Bias methinks
10
Hi,

I will have to power a project which consists in many modules and which will have to deal with many voltages (12V, 9V, 5V and 3.3V).

I am planning to hook up the 12V using a female connector (matching the power supply).
The main module consists of basically voltage regulators. Now What is a good way to transport all of the different voltages to the various modules?

I mean: they are 20-80cm apart and each module should receive all of the different supplies (plus GND).

Each module will be soldered separately.

Looking onto the internet I am a bit confused on which connector to use and how to use my cables with them. Also while soldering is ok, I would prefer (if possible) a solderless solution.

I hope I stated the problem correctly,
thanks for reading.
Pages: [1] 2 3 ... 10