Recent Posts

Pages: 1 ... 7 8 [9] 10
81
Seems like a fun soldering test! I'd like to get it a go if you plan to offer these as a kit?
82
Hardware / Re: Dubbio corrente erogata ar...
Last post by uwefed - Today at 01:14 am
Quote
Praticamente ci resterei secco?
La corrente elettrica é pericolosa se circola nel corpo umano. Per far circolare 5A nel corpo serve una tensione molto molto piú alta dei 5V oppure una tensione piú alta e un contatto tra conduttore e corpo umano molto buono ridotto da un liquido ben conducente come una soluzione salina o un eletrolita.

Ciao Uwe
83
I ask friend to test my sketch on his arduino  and he have same problem, anyone can help?
84
I am currently trying to code on an Arduino Uno board and am trying to have 5 strips of LED lights turn on and off as certain sounds levels are achieved. Imagine 5 acrylic panels standing about 4 inches behind each other then as the first level is achieved, the first panel turns on while the remaining four are off. As the volume continues to increase, the previous panel turns off and the next one turns on. I have the necessary parts needed - LED strip, 5V power supply, and adjustable gain audio sensor, wires. Now help is needed on how to code it to work together.

If it any help this is the code I have so far:

#include <Adafruit_NeoPixel.h>

#define PIN 7
//#define PIN 17  // Teensy board needs this pin [5V]
#define LED_COUNT 150

//Microphone portion
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;

// Create an instance of the Adafruit_NeoPixel class called "leds".
// That'll be what we refer to from here on...

Adafruit_NeoPixel leds = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
  leds.begin();  // Call this to start up the LED strip.
  for (int kled=0; kled<LED_COUNT; kled++) {
    leds.setPixelColor(kled,255,100,100);  // red, green, blue intensity from 0-255
  }
  leds.show();

   Serial.begin(9600);
}

 void loop()
{
 
  // Set all lights to red
  for (int kled=0; kled<LED_COUNT; kled++) {
    leds.setPixelColor(kled,10,40,40);  // red, green, blue intensity from 0-255
  }
  leds.show();
  delay(100);

//Microphone portion
   unsigned long startMillis= millis();  // Start of sample window
   unsigned int peakToPeak = 0;   // peak-to-peak level

   unsigned int signalMax = 0;
   unsigned int signalMin = 1024;

   // collect data for 50 mS
   while (millis() - startMillis < sampleWindow)
   {
      sample = analogRead(0);
      if (sample < 1024)  // toss out spurious readings
      {
         if (sample > signalMax)
         {
            signalMax = sample;  // save just the max levels
         }
         else if (sample < signalMin)
         {
            signalMin = sample;  // save just the min levels
         }
      }
   }
   peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
   double volts = (peakToPeak * 5.0) / 1024;  // convert to volts

   Serial.println(volts);

   if (1.00 < volts <2.00)
     { for (int kled=0; kled<LED_COUNT; kled++)
      leds.setPixelColor(kled,0,0,0);
      }
    else if (volts < 1.00, volts > 2.00)
    { for (int kled=0; kled<LED_COUNT; kled++)
      leds.setPixelColor(kled,255,0,0);
      }
}
85
Project Guidance / Best way to modify broken head...
Last post by Ovog - Today at 01:06 am
Hello, so I noticed the other day i Had a lot of broken headphones, that only output sound from one earbud.

Trying to reclycle them, I cut them, and stripped the cable, exposing the two conectors, it is the wild hair type of cable: I managed to test them with the arduino, but conecting them to the protoboard was a nightmare, and I don't know if anybody knows a way to make them more "arduino-able" or "protoboard-able" to conect them more easily.

Thanks in advance and excuse any spelling errors.
86
Which is why they invented the Vgs(on) spec which specifies (at a certain drain voltage and current) the voltage when the MOSFET can be considered "on".

Vgs(th) is more suited to SPICE modeling.
I just checked all of my MOSFET datasheets* and none of them have that spec. Are you confusing it with RDS(on)?

*2N7000, DMG6968, DMG3415, BSS84, BSS138, FQP27P06 and FQP30N06L
87
Robotics / Re: robot NOT doable for novic...
Last post by pert - Today at 01:01 am
When you post links please use the chain links icon on the toolbar to make them clickable.

Beside the metal parts that i've put together to make it look like an arm and screws/wires, these are included in the kit:
* 1 "Solderless Breadboard" about 2" x 8"
* There are 3 "boards" about 2" x 3"
(one says "CNC SHELD", one says "UNO … Digital PWM", another one looks almost the same but says "Digital PWM 20-011-953 SainSmart UNO")

* 4 tiny "boards" about 1" x 3/4"
* 1 small remote control "Special for MP3"
* The sticker on the box says "Starter Kit for Arduino   20-013-308"

I found some pictures online that look somewhat like my kit:
the electronic parts: http://www.ebay.com/itm/US-Ship-Arduino-CNC-kit-UNO-R3-Shield-4-x-A4988-Drivers-/321991713978
So are you saying that your kit is not the one I linked previously:
https://www.sainsmart.com/sainsmart-uno-r3-basic-starter-kit-for-arduino-uno-r3.html
That's SainSmart SKU 20-013-308. That CNC kit is not going to be very useful with your arm kit because the CNC kit is made for driving stepper motors but the arm is made to use servo motors.

the arm: http://www.ebay.com/itm/New-6DOF-Aluminium-Mechanical-Robotic-Arm-Clamp-Claw-Mount-Robot-Kit-/182210607390?hash=item2a6c99391e:g:3~IAAOSwLF1X9NkZ

Pert, the picture of servo ks-35 18 from your link is the one i have (the link is not in english though).
From what I can see that arm uses at least 5 servos. If you only have one you can see the problem. I don't think you could even assemble the arm without having all the servos. I see the kit says "no base". Without some sort of motor in the base the arm will not be able to rotate so it will be pretty limited in motion.

You also need to make sure that the servos you get are compatible with the kit. They need to fit the mounts and also be strong enough to hold the weight of the arm and the object the arm is holding. The lowest servo will tend to have the most load on it because it's supporting the entire arm and other servos and there will be quite a bit of leverage when the arm is extended outwards. Don't forget you need a sufficient power supply to run the servos. You definitely don't want to power it off the Uno.

Figure out the entire bill of materials (BOM) for your project and get the parts ordered. While you wait you can get to learning the basics with the parts you do have so you'll be able to program the arm to do some cool stuff once you get it finished.

saw one that said "sweep" and had the coding (i guess it makes the arm move in some direction?) but the problem is i don't know how to put those electronic parts together yet. I hope you guys would give me some instruction please.
Read my last reply. I already told you how to wire the servo. It's time for you to take responsibility for your own learning. We're happy to help you here but I'm not going to spoon feed you.
88
Microcontrollers / Re: Is there a Mega2560 in a b...
Last post by LarryD - Today at 12:59 am
Not moving the DTR header to the left of resistor and DTR cap?

I guess you have to say its in the bag at some point.

.
89
@BulldogLowell: in my (still apparently very limited) mental concept of object programing I will prefer not to mix (traverse) two completely different classes but rather to have my own and instantiate the two objects I need to work with inside that my class.

But thanks for the example in any case - it pushes my knowledge horizons a bit further and for sure will come handy one day (soon)!

@PaulS: my apology.

Initially I only replaced the code of the "LibB::begin(int seedint)" method with your suggested code "_nestedlibAprivate = new LibA(seedint);"

Apparently the problem was that I left the internal pointer variable "_nestedlibAprivate" declaration as "static". Once this was remedied it now works perfectly to my expectation. Thanks a lot for effort and pointing me in the right direction.

For the reference of others coming across this post I include the complete code again in working version. It is now enriched with some serial.prints (some of them redundant) to see what's going on internally in the code.

The way I now understand it: the "new" function (?) instantiates new object and returns pointer to it. The pointer in my case is stored within the LibB internal variable _nestedlibAprivate.

Main body:
Code: [Select]
#include "LibA.h"
#include "LibB.h"

LibA myliba(11);
LibB mylibb(33);

void setup() {
  Serial.begin(115200);
  mylibb.begin(66);
}

void loop() {
  myliba.IncrementArg1();
  Serial.print("LibA value: ");
  Serial.println(myliba.WhatisArg1());

  mylibb.IncrementArg1and2();
  Serial.print("LibB value: ");
  Serial.println(mylibb.WhatisArg1());
  Serial.print("LibB nested LibA value: ");
  Serial.println(mylibb.WhatisArg2());
 
  delay(5000);
}


LibA.h
Code: [Select]
#ifndef LibA_h
#define LibA_h

#include "Arduino.h"

class LibA
{
  public:
    LibA(int LibAarg1);
    void IncrementArg1();
    int WhatisArg1();
  private:
    int _Ainternal;
};

#endif


LibA.cpp
Code: [Select]
#include "Arduino.h"
#include "LibA.h"

LibA::LibA(int LibAarg1)
{
  _Ainternal = LibAarg1;
}

void LibA::IncrementArg1()
{
  _Ainternal++;
}

int LibA::WhatisArg1() {
  return _Ainternal;
}


LibB.h
Code: [Select]
#ifndef LibB_h
#define LibB_h

#include "Arduino.h"
#include "LibA.h"


class LibB
{
  public:
 
    LibB(int LibBarg1);
    void begin(int seedint);
   
    void IncrementArg1and2();
    int WhatisArg1();
    int WhatisArg2();
  private:
    int _Binternal;
    LibA* _nestedlibAprivate;   
};

#endif


LibB.cpp
Code: [Select]
#include "Arduino.h"
#include "LibB.h"
#include "LibA.h"

LibB::LibB(int LibBarg1)
{
  _Binternal = LibBarg1;
}

void LibB::IncrementArg1and2()
{
  _Binternal++;
  Serial.print("LibB internal increment: ");
  Serial.println(_Binternal); 

  _nestedlibAprivate->IncrementArg1();
  Serial.print("Nested LibA IncrementArg1: ");
  Serial.println(_nestedlibAprivate->WhatisArg1()); 
}

int LibB::WhatisArg1() {
  return _Binternal;
}

int LibB::WhatisArg2() {
  return _nestedlibAprivate->WhatisArg1();
}

void LibB::begin(int seedint)
{
  _nestedlibAprivate = new LibA(seedint);
}
90
Generale / Re: Controllare motore brushed
Last post by uwefed - Today at 12:57 am
Il cavo verde viene usato per mettere a massa l'involucro del motore e fini di antiradiodisturbi. Non serve collegarlo per farlo girare.
Alimentazone sono il bianco e il blu.

Ti serve che il motore giri solo in un verso o in entrambi i versi?
Ciao Uwe
Pages: 1 ... 7 8 [9] 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