Recent Posts

Pages: 1 ... 8 9 [10]
Deutsch / Re: Servo / PWM Signal einer T...
Last post by ElEspanol - Today at 04:43 pm
-100 entspicht 1,0ms, +100 entspicht 2ms am Empfängerausgang.

Gegen pulseIn spricht, dass es blockiert. Du solltest also ein kurzes Timeout nehmen, z.B. 30ms
Bei normalen Servosteuersignalen kommt alle 20ms (nennt man Framelength, die Länge kann abweichen nach Hersteller) ein Signal von 0,5ms bis 2,5ms, bei normaler Einstellung des Senders eben von 1,0ms bis 2,0ms.

Und die Zeit ist proportional zum Ausschlag des Servohorns.

Schaue dir das mal mit einem Oszi oder LA an, dann geht dir ein Licht auf.
Bar Sport / Re: [OT ITA] Lo spamm bar
Last post by maubarzi - Today at 04:43 pm
Io ho dato il via ai mortaretti perchè sono incuriosito da questi aggeggi e da quello che ci si può fare, però ogni volta che si parla di laser esce Etem che mette in guardia sulle giuste protezioni, ecc. ecc. ecc. dicendo che basta niente per fare danni irreparabili e questo mi fa sempre desistere.
Durante le prove, tipicamente, è tutto un po' "volante", sarebbe pure facile fare caxxate e dirigere il laser verso la superficie sbagliata.
Poi penso ai ragazzi che con pochi soldi si possono fare una cosa che a prima vista sembra una figata e poi magari scoprono che la prima vista diventa anche l'ultima ;)
Quindi mi interessava un po' l'opinione generale per capire se ero io un po' troppo esagerato.
Project Guidance / Re: a vehicle that remembers t...
Last post by PaulS - Today at 04:41 pm
Can I also chase people down with that?
Unless they are world class sprinters...
Programming Questions / Re: LED blink between 2 boards
Last post by blh64 - Today at 04:40 pm
You are close!  You want to check the led blinking/not blinking outside of receiving radio data.  You also want to check the state of your button press on the receiver outside of the radio receiving data.

This code should get you close:
Code: [Select]

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9, 10); // CE, CSN
const byte address[6] = "00001";

// new varibles for button section
boolean button_state = false;
boolean led_running = false;
const int led_pin = 3;
const int buttonPin = 7;

// new varibles from millis
unsigned long previousMillis = 0;
const long interval = 1000;
int ledState = LOW;

void setup() {
  pinMode(led_pin, OUTPUT);
  pinMode(buttonPin, INPUT);   // initialize the pushbutton pin as an input:

  radio.openReadingPipe(0, address);   //Setting the address at which we will receive the data
  radio.setPALevel(RF24_PA_MIN);       //You can set this as minimum or maximum depending on the distance between the transmitter and receiver.
  radio.startListening();              //This sets the module as receiver

} //endSET UP

void loop() {
  currentMillis = millis();

  // flashes the LED, if running
  if ( led_running == true ) {
    if (currentMillis - previousMillis >= interval) {
      // save the last time you blinked the LED
      previousMillis = currentMillis;

      // if the LED is off turn it on and vice-versa:
      if (ledState == LOW) {
        ledState = HIGH;
      } else {
        ledState = LOW;
      // set the LED with the ledState of the variable:
      digitalWrite(led_pin, ledState);

  if (radio.available())     {         //Looking for the data.

    char text[32] = "";                 //Saving the incoming data, sizeof(text));    //Reading the data, sizeof(button_state));    //Reading the data

    if (button_state == HIGH) { /// from Transmitter {
      Serial.println(text); // text from Transmitter
      led_working = true;   // start flashing LED
    } else
      led_working = false;   // stop flashing LED
    digitalWrite(led_pin, LOW); // and make sure it is off

    if ( digitalRead( buttonPin ) == HIGH ) {
      // reset LED
      digitalWrite(led_pin, LOW);
      led_working = false;
      Serial.println("button on RX pressed");


Note: The typical way to wire up a button is to connect one side to a digital pin and the other to ground.  You then enable the Arduino internal pullups such that the pin reads HIGH when not pressed and LOW when it is pressed and shorted to ground.  Your code does not do that but I don't know how you have your button wired.  If you have on one side of the button tied to +5V and the other to the digital input pin, you need an external pulldown resistor to make it work.
Français / Re: Arduino Nano - Pas assez ...
Last post by fdufnews - Today at 04:39 pm
PS mon transfo fait 5V  700mah
Avant que tout le monde s'emballe il serait peut-être bon de savoir ce que TU appelles transfo.
Tu as un lien vers le "tranfo" que tu as acheté?
Project Guidance / Re: Led stereo VU-meter
Last post by KrisKasprzak - Today at 04:39 pm
...agree with a comment above. There are some helpful people mixed with useless comments on this forum.

have you tried outputting your led array to the serial plotter?

add to setup()


then in your for loop add


access serial monitor from tools, the talk (or hum a constant level) into you mic. Maybe the mics output voltages are too small to detect.
Français / Re: Code GPS incompréhensible
Last post by Vision_Bag - Today at 04:38 pm
En effet et sur mon code ou il y a juste mon gps j'avais mit les pins 10/11 ce qui expliquerait le problème je vais essayer de suite avec les pins 52/53 je te redit.
I took it from a tutorial that also suggests an automatic way to do it- but it's just reading on and off:
That snippet you posted doesn't read anything.

We can't see how, or if, you call that function.
Français / Re: compatibilité ATM328P et A...
Last post by dbrion06 - Today at 04:36 pm
"Certains croquis comme RF12M compile biensur 644P et "cause"  parfaitement avec un autre RF12M qui est sur 328P;
Lorsque je mets mon croquis qui utilise le RF12M sur 644 alors qu'il fonctionne sur 328 il ne cause plus alors que je n'ai pas d'erreur.
Cela semble confirmer le diagnostic pessimiste (plus que le mien) de  68tjs....
Quelles ont été vos sources d'inspiration pour porter le 644?
guess it's because the cod is very crude.
Maybe you need a grouper or a halibut or a salmon, instead. 8)

Code: [Select]
      digitalWrite(mutePin, HIGH);   // turns the motor on
What? What do you REALLY have connected to that pin?

Code: [Select]
  if (digitalRead(mutePin == HIGH))
Reading from the true pin or the false pin is rarely the right thing to do.

YOU control the state of the mutePin. Why do you think you need to read its state, even if you were doing it correctly?

Code: [Select]
          if(mutePin == HIGH)noTone(buzzer);
50 is never going to equal 1...
Pages: 1 ... 8 9 [10]