Recent Posts

Pages: [1] 2 3 ... 10
You seem to have copied some functions from the ArduinoFIS library and inserted setup() and loop() functions which do not use the FIS functions at all. Your setup function calls Serial.begin and randomSeed twice. Your loop function calls the random function twice but does not use the result.
That code does compile but it doesn't appear to do anything useful, certainly nothing to do with fuzzy logic.

The serial input basics tutorial shows how reliably read and parse serial data.
Français / Re: code pour plusieurs moteur...
Last post by FRIDA24 - Today at 08:05 pm
J'ai mis "etat" à la place de "numPin",mais le résultat est le mème, 
qui va donc bien dire à maSequence.etat d'être LOW ou HIGH ? , c'est le fait qu'il passe en dessous des 11 cms ( donc représenté ici par t0 >= maSequence.debut) ;  et la fin , c'est que le temps d'allumage est passé t0 > maSequence.fin ) &&  que digitalWrite(maSequence.etat, HIGH)ou (LOW) , mais ça veut pas; je dois rater quelque chose dans  la logique du système !

Code: [Select]
struct elementSequence_t {
  byte numPin;
  unsigned long debut;
  unsigned long fin;
  byte etat;
elementSequence_t maSequence[] = {   //  Initialiser la structure elementSequence_t avec les variables  maSequence[]
  {11, 0ul, 500ul, LOW},
  {6, 500ul, 8500ul, LOW},
  {13, 500ul, 6500ul, LOW},
  {10, 8500ul, 38500ul, LOW},
  {9, 8500ul, 18500ul, LOW},
  {7, 18500ul, 26500ul, LOW},
  {6, 38500ul, 46500ul, LOW},
  {12, 46500ul, 56500ul, LOW},
  {3, 56500ul, 62500ul, LOW},
  {7, 56500ul, 64500ul, LOW},
  {8, 64500ul, 84500ul, LOW}
const byte nbElementSequence = sizeof(maSequence) / sizeof(maSequence[0]);
unsigned long topDistanceCritique;

void setup() {
  topDistanceCritique = 2300ul; // on simule que l'on est passé sous 11cm à ce moment là
  for (byte i = 0; i < nbElementSequence; i++) {
    pinMode(maSequence[i].numPin, OUTPUT);
    digitalWrite(maSequence[i].numPin, maSequence[i].etat);
void loop()
  unsigned long t0 = millis() - topDistanceCritique;

  for (byte i = 0; i < nbElementSequence; i++) {
    if (maSequence[i].etat == LOW) {

      // on regarde s'il faut l'allumer
      if ((t0 >= maSequence[i].debut) && (t0 <= maSequence[i].fin)) {
        // FAIRE DES TRUCS
        digitalWrite(maSequence[i].etat, HIGH);  //<-------------
    } else {
      // on est HIGH on regarde s'il faut éteindre, c'est uniquement après la fin
      if ((t0 > maSequence[i].fin)) {
        // FAIRE DES TRUCS
        digitalWrite(maSequence[i].etat, LOW); //<----------------
  } // end for

Programming Questions / Pointer attributes
Last post by Dr_Quark - Today at 08:04 pm
If I declare the following:

byte byte_1 ;
byte byte_2 ;
byte *b1 ;
byte *b2 ;

why does this work?

b1 = &byte_1 ;
b2 = &byte_2 ;
Serial.print(b1 - b2) ; (this turns out to be -1)

and this does not work?

Serial.println(b1) ; (the error is "no matching function for call to 'println(byte*, int)' "

It seems to me that if you can do math with pointers, eg, they produce unsigned longs, why can't you print them as unsigned longs?

Hardware / Re: Re: ¿Se puede tener un rel...
Last post by surbyte - Today at 08:04 pm
Sabes que el tema es viejo y sabes que esta mal reabrirlo y lo haces igual
No lees las normas del foro que dicen que crees un hilo nuevo?

Bueno ahora estas en un hilo nuevo.

Modifica si quieres el post para poner la referencia a alquel en el que escribiste.
Project Guidance / Arduinos and hydrolics
Last post by birddseedd - Today at 08:04 pm
I was given the number of i-beams so I've decided to build a back plow for my truck. I do have a pump assembly for a front plow, but that has limited options. For example I need cylinders that will both push and pull but the pump assembly was only Built 4 cylinders that push. I can get around that by combining two of the controls into 1 cylinder but then I don't have enough controls to run the entire plow.
 Which is where I'm thinking an Arduino might come in handy. Is there a valve that can be driven by Arduino? I'm not sure what actions I would have since there is typically a valve body where all of the pressure comes into and then each valve opens up as desired to flow fluid in two different cylinders. What options would I have with an Arduino? The valve operation itself is simple, and it drives a valve and it activates, programming it would likely take no more than 5 minutes even at my school level. But what Hardware is there available they could accomplish this?

I would need a controller to push the plow down and possibly lift it up ( I was originally going to Spring load it but hydraulic could work for this). Each wing of the plow would need to be pushed into directions as well. So that's a total of six movements but it can be done with three cylinders if I have the type that push and pull. It would still mean 6 valve solenoids.
 Thank you for the help
Software / Re: sensore non lineare
Last post by mirkoelettronics - Today at 08:04 pm
in allegato il datasheet del sensore che collegato ad una resistenza di pull-up di 906 ohm a 5volt
Please help!
Proyectos / MOVED: Control de tensión en c...
Last post by surbyte - Today at 08:00 pm
Hardware / Re: Control de tensión en circ...
Last post by surbyte - Today at 08:00 pm
A ese ritmo con motor parado te quedas sin batería muy rápidamente en invierno. Considera lo que haces y supongo debe ser 2.2A y te has confundido.

Hilo movido a Hardware
Pages: [1] 2 3 ... 10