Recent Posts

Pages: [1] 2 3 ... 10
1
Project Guidance / Re: Arduino to control 24 moto...
Last post by JayMan - Today at 05:39 am
You could switch the dc with that relay. It will work perfectly fine on dc I am sure.
2
No, RS485 with twisted cable to prevent noise  pickup.
3
I connected an two Arduino Nanos by the vin and ground ports and it was working for about five minutes until they both stopped uploading.

just to be totally clear

vin<--->vin
gnd<-->gnd
4
Sensors / Re: 3+ MS5803 Sensors on I2C B...
Last post by CrossRoads - Today at 05:32 am
Use the signal that you are controlling the power wire with into the address line instead.  The part you want to talk to, pull the line low, access address 0x76. The others will be at 0x77 and not respond. No need to wait around while they boot.
5
Audio / Re: Range of FHT Outputs
Last post by austinsid - Today at 05:31 am
Look, if the values that I'm getting match what I'm expecting then I'm happy. And they do. When I play music with high frequencies, the high frequency bins go up in value and when I play music with low frequencies the low frequency bins go up in value.

I don't care much whether that's good enough for you.

What I'm confused about is why no one has bothered to try to answer the question I did ask, rather than bring up irrelevant information. Harmonics above 19.2kHz aren't loud, which is why I don't care about them.

Aliasing won't cause frequency bins to be lower than they should be; my question regards bins that occasionally dip far below what they should be.
6
Hi UKHeliBob,

I figured out what the problem was. It is not the code. It the HC-05 Protocal. Change the baulrate to 115200,1,0 (1 stop bits) from 115200,0,0 solved the communication issue. And as for the serial output line, Serial.write((byte*)&hat,30); for RX,TX and Serial1.write((byte*)&hat,30); RX1/TX1. Tested and confirmed working.

7
Sensors / mpu 6050 crosstalk between pit...
Last post by karaposu - Today at 05:26 am
Hello guys; I was wodering if there is a solition for this ? I am reading quaternion values and there is crosstalk . I need to wtire a code which includes seperate values.  Any help ll make me fell happy : )
8
#include "SdFat.h"
SdFat SD;
#include<SPI.h>
#include<Ethernet.h>
byte mymac[6];
byte myip[4];
byte mynm[4];
byte mygw[4];
byte mydns[4];
byte server[4];
EthernetClient client;
void setup() {
  Serial.begin(115200);
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);

  delay(2000);
  if (!SD.begin(10)) {
    Serial.println( F("SD fail") );
    delay(1000);
  }
  else Serial.println( F("SD ok") );
  File fh = SD.open("nw_set2.txt", FILE_READ);
  char netbuffer[32];
  if (!fh)
  { Serial.println( F("SD open fail") );
    return;
    delay(1000);
  }
  int chpos = 0;
  int lineno = 0;
  while (fh.available())
  {
    char ch = fh.read();
    if (ch == '\n') {
      chpos = 0;
      switch (lineno) {
        case 0:
          if (getmac(netbuffer, mymac)); //Serial.println(F("mac ok"));
          break;
        case 1:
          if (getip(netbuffer, myip)); //Serial.println(F("ip ok"));
          break;
        case 2:
          if (getip(netbuffer, mynm)); //Serial.println(F("sm ok"));
          break;
        case 3:
          if (getip(netbuffer, mygw)); //Serial.println(F("gw ok"));
          break;
        case 4:
          if (getip(netbuffer, mydns)); //Serial.println(F("dns ok"));
          break;
        case 5:
          if (getip(netbuffer, server)); //Serial.println(F("server is ok"));
          break;
      }
      lineno++;

    }
    else if (ch == '\r') {
      //do nothing
    }
    else if (chpos < 31) {
      netbuffer[chpos] = ch;
      chpos++;
      netbuffer[chpos] = 0;
    }
  }
  fh.close();



  Serial.print( F("\r\nmac") );
  printArrayTo( Serial, mymac, sizeof(mymac), ':' );

  Serial.print( F("\r\nip") );
  printArrayTo( Serial, myip, sizeof(myip), '.' );

  Serial.print( F("\r\nNM") );
  printArrayTo( Serial, mynm, sizeof(mynm), '.' );

  Serial.print( F("\r\ngw") );
  printArrayTo( Serial, mygw, sizeof(mygw), '.' );

  Serial.print( F("\r\ndns") );
  printArrayTo( Serial, mydns, sizeof(mydns), '.' );

  Serial.print( F("\r\nserver") );
  printArrayTo( Serial, server, sizeof(server), '.' );

  //Serial.println( F("\r\nStrating ethernet") );
  Ethernet.begin(mymac, myip, mydns, mygw, mynm);
  //Serial.println(Ethernet.localIP());


  Serial.println( F("connecting...") );
  delay(5000);
  if (client.connect(server, 6666)) {
    Serial.println( F("connected") );
  } else {
    Serial.println( F("connection failed") );
    delay(1000);

  }

}

void loop() {



}


void printArrayTo( Stream & out, byte *array, size_t size, char delim )
{
  for (size_t i = 0; i < size; i++) {
    // print one number
    out.print( *array++ );

    // print the delimiter, but not after the last byte
    if (i < size - 1)
      out.print( delim );
  }
}

byte getmac(char* macbuf, byte* thismac) {
  byte thislen = strlen(macbuf);
  byte thisoctet = 1;
  thismac[0] = strtol(&macbuf[0], NULL, 16);
  for (int x = 0; x < thislen; x++) {
    if (macbuf
  • == ':') {

      thismac[thisoctet] = strtol(&macbuf[x + 1], NULL, 16);
      thisoctet++;
    }
  }
  if (thisoctet == 6)return (1);
  else return (0);
}


byte getip(char* ipbuf, byte* thisip) {
  byte thislen = strlen(ipbuf);
  byte thisoctet = 1;
  thisip[0] = atoi(&ipbuf[0]);
  for (int x = 0; x < thislen; x++) {
    if (ipbuf
  • == '.') {

      thisip[thisoctet] = atoi(&ipbuf[x + 1]);
      thisoctet++;
    }
  }
  if (thisoctet == 4)return (1);
  else return (0);
}
9
Project Guidance / Re: rectified AC phase control
Last post by TomGeorge - Today at 05:17 am
Hi,
Your scope probes, the gnd on each is connected together at the scope.

So when you were monitoring the input and the output of the opto, the gnds from each channel were connecting the input and the output of the opto.
So it defeated the isolation you needed to be able to see full AC at the opto input.

Tom... :)
10
Audio / Re: Range of FHT Outputs
Last post by jremington - Today at 05:06 am
Sorry, I did not notice that you were sampling at higher than the default rate of 9.6 kHz for analogRead().

Regardless, for a meaningful result, it is essential to prevent any frequencies above 1/2 the sampling frequency from reaching the ADC, as their amplitudes will simply show up elsewhere in the spectrum.


Quote
mic is right next to a speaker producing loud sounds entirely within half of the sampling rate.
You haven't heard about harmonics, evidently. Good luck on your journey.
Pages: [1] 2 3 ... 10