Recent Posts

Pages: [1] 2 3 ... 10
1
Français / Re: Problème installation ESP3...
Last post by fdufnews - Today at 01:02 pm
Le plus "simple" c'est de cliquer sur le bouton téléverser et de faire la séquence avec les boutons.

Je pense que le timing n'est pas très critique. Lorsqu'on utilise esptool en ligne de commande tant que l'on voit le message "Connecting........_____....._____....._____....."
on peut lancer la séquence de flashage.
2
General Electronics / Re: Interference on an input
Last post by allym - Today at 01:02 pm
Alarm output is active high.

ISR is set to FALLING.

Apologies, how do I determine whether it's Open Collector or push pull?


Code: [Select]

   pinMode(7, INPUT_PULLUP);
   attachInterrupt(digitalPinToInterrupt(7), IRQcounter, FALLING);


Thank you.
3
Aha, that's an helpful insight, totally misunderstood what was going on. Wil try to do some recalculations on what resistors are needed on Rset. Thanks!
4
Bonjour

Je n'y connait rien en programmation
J'aimerai que ma leonardo soit reconnu comme un joystick sous Windows 10 mais il faut juste que la carte Control un potentiomètre et un capteur de distance.

Merci
5
General Electronics / Re: Control current flowing in...
Last post by MarkT - Today at 12:59 pm
Most of the power is in the armature current, the field winding is just to create a magnetic field.

Since this is likely a universal motor you're going to have to characterize it for DC, since the
field winding inductance will not have any effect at DC (ie won't be limiting field
current).

A field coil motor is always going to be more complicated to manage than a PMDC motor, as
you have to consider the losses in the field winding.  You can of course get the benefit of
regulating via the field winding (lower power circuitry), but you have to understand about
motor control to do this well.
6
Français / Re: Problème module RTC DS1307...
Last post by fdufnews - Today at 12:57 pm
Non, 2,8V c'est une pile qui est encore bonne. La tenson Vbat doit être comprise entre 2V et 3,5V.
As-tu fait une inspection visuelle de ta carte pour vérifier s'il n'y aurait pas une mauvaise soudure autour du circuit de la RTC plus particulièrement dans son circuit d'alimentation?
7
Deutsch / Re: Verbindungsprobleme mit HC...
Last post by dony - Today at 12:56 pm
Hallo,

Ich schmeiß mal mein geschreibsel über die 2 Module dazu.

Grüße,
Donny
8
Sensors / KY-002 shock sensor is not act...
Last post by sofia_wwz - Today at 12:55 pm
Hi

I am new to arduino programming. My idea is a garage parking where the sensors used are ultrasonic sensor, obstacle avoidance sensor, ky-002 shock sensor.

When the ultrasonic sensor detects that it is 4cm, the garage door opens. The obstacle avoidance sensor will be activated if there are objects. Then when it reaches the shock sensor part, it doesn't work! I tried put the shock sensor code into another empty sketch, it works.

I have no idea where I have gone wrong. Would appreciate any help given. Thanks

Code

Code: [Select]


const int trigPin = 9;
const int echoPin = 10;

long duration;
int distance, temp = -1;

//Shock Sensor
int shockPin = 11; // Use Pin 10 as our Input
int shockVal = HIGH; // This is where we record our shock measurement
boolean bAlarm = false;

unsigned long lastShockTime; // Record the time that we measured a shock

int shockAlarmTime = 250; // Number of milli seconds to keep the shock alarm
high

void setup() {

 lcd.init();

 Serial.begin(9600);

 // Ultrasonic Sensor
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
 lcd.backlight();
 lcd.setCursor(0, 0);
 lcd.print("Distance left:");

 // Obstacle Avoidance Sensor
 pinMode(8, INPUT);// set pin as input

 // Shock Sensor
 pinMode (shockPin, INPUT) ; // input from the KY-002

}


void loop() {

 // Clears the trigPin
 digitalWrite( trigPin , LOW);
 delayMicroseconds(2);

 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin , LOW);
 // Reads the echoPin, returns the sound wave
 // travel time in microseconds
 duration = pulseIn( echoPin , HIGH);

 distance = duration * 0.034 / 2;

 test.in( distance ); // software filter
 distance = test.out();

 // Prints the distance on the Serial Monitor
 Serial.print("Distance left: ");
 Serial.println(distance);

 if ( temp != distance ) {
 temp = distance;

 lcd.setCursor(0, 1);
 lcd.print("          "); //if havent detect
 lcd.setCursor(0, 1);
 lcd.print(distance);
 lcd.print(" CM");

 if (distance == 4) {

  lcd.setCursor(0, 1);
  lcd.print("Door Opens");
  delay(500);
  // Once the car enters, the obstacle avoidance sensor checks if there are obstacles in the way..
  int detect = digitalRead(8);// read obstacle status and store it into "detect"
  lcd.clear();
  lcd.setCursor(0, 0);
  delay(300);
  lcd.print("Detection:");
  if (detect == LOW) {
    lcd.setCursor(0, 1);
    lcd.print("Obstacle Present");
  } else {
    lcd.setCursor(0, 1);
    lcd.print("No Obstacle");
  }

  int shockVal = digitalRead(shockPin) ; // read the value from our sensor

  if (shockVal == LOW) // If we're in an alarm state
  {
    lastShockTime = millis(); // record the time of the shock
    // The following is so you don't scroll on the output screen
    if (!bAlarm) {
      Serial.println("Shock Alarm");
      bAlarm = true;
    }
  }
  else
  {
    if ( (millis() - lastShockTime) > shockAlarmTime  &&  bAlarm) {
      Serial.println("no alarm");
      bAlarm = false;
    }
  }
  delay(200);
  exit(0);

}

}

}
9
Project Guidance / Re: How can I Split a string ?
Last post by ardly - Today at 12:55 pm
Why not to try to read a first char with charAt() and then based on it result is A do this, if S do that

 e.g. if A read the second and third and that is the angle (in this case angle always must be 2 chars) then read 4 th char and it is a direction etc...
The OP should think clearly about the format he is inventing to make it easy to code.

For example if in the Angle example he used a numeric field to indicate left or right then all the messages would have the format
<character>,<integer>,<integer>;

He could parse out the parameters then branch depending on the character i.e. less code in fewer places.

I am not even sure though why he has three parameters in the Speed and Distance Messages?
Also why not just use 0...360 for the angle rather than introducing Left and Right?
The messages could probably be simplified to all just be;
<character>,<integer>;
10
Hardware / Re: Pilotare 4 motori cw/ccw
Last post by tullio1995 - Today at 12:53 pm
Avevo pensato a due in serie o prenderne una da 7,4v dato che il voltaggio dei motori va da 4v a 6v.
Con una sola da 3.7v non riuscirei ad alimentare i motori giusto?
Pages: [1] 2 3 ... 10