Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Hi check this note "Migrating from Json5 to Json6"

https://arduinojson.org/v6/doc/upgrade/

You need either to install the Json5 library or to modify your sketch to comply with the Json6 library that you probably have installed.
12
Displays / SPI OLED SSD1331 with Nano 33 ...
Last post by LittleHobbyShop - Today at 06:43 pm
Can anyone point me in the direction of some support for an SSD1331 SPI OLED display on the new Nano 33 BLE? I had some success with the adafruit ssd1331 library on an original nano but switching to this new one I am struggling and get errors at compile related to hardware SPI, no doubt due to the different chip and those libraries not supporting it. These are the errors I get with the displayOnOffTest example:

error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setClockDivider'
error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setBitOrder'
error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setDataMode'

Perhaps the library can be modified but I don't know where to start?

13
Sensors / Re: BME reading a degree too h...
Last post by wvmarle - Today at 06:43 pm
Code: [Select]
#define adjustment -1;
sentData.temperature = bme280.readTemperature() + adjustment;

Not sure if this will compile, but code is wrong.
A #define statement shouldn't end with a ;, as whatever comes behind the space is a replacement of what comes before the space.

A more elegant way would be:

Code: [Select]

const float adjustment = -1;
sentData.temperature = bme280.readTemperature() + adjustment;
14
Deutsch / Re: NTP Antwort identifizieren
Last post by Rentner - Today at 06:42 pm
Hallo,

hier ein Link zu UDP

UDP


die Zuordnung der Daten wird über die Port-Nr festgelegt. Sollte doch eigendlich reichen.

Anfrage über localPort ->  an NTP Server ziel port 123
Antwort vom Server -> zuück an local Port


Auschnitt aus dem Sketch

Code: [Select]


// -------------- Datum Zeit von Timeserver holen-------------
time_t get_time() {
  Serial.println(F("UDP starten"));
  udp.begin(localPort);  // z.B 2390

  // Paketdaten zur NTP Anfrage
  memset(paket, 0, 48);
  paket[0] = 0b11100011;
  paket[1] = 0;
  paket[2] = 6;
  paket[3] = 0xEC;
  paket[12] = 49;
  paket[13] = 0x4E;
  paket[14] = 49;
  paket[15] = 52;

  udp.beginPacket(FritzboxIP, 123);
  udp.write(paket, NTP_PACKET_SIZE);
  udp.endPacket();
  delay(1000);
  int cb = udp.parsePacket();
  if (!cb) {
    Serial.println("kein NTP Paket");
  }
  else {

    udp.read(paket, NTP_PACKET_SIZE);
    Serial.println("Zeit synchron");
  }
  udp.stop();// local Port wieder freigeben



 

Heinz

15
Français / Re: Probleme avec ecran LCD
Last post by kams - Today at 06:42 pm
Salut Bricofoy,
je viens de tester comme tu me l'as dit mais sans suite, voici le code :
Code: [Select]
#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <LiquidCrystal.h>
int data;
 
#define RST_PIN         9          // Configurable, see typical pin layout above
#define SS_PIN          10         // Configurable, see typical pin layout above
#define LED_VERT         4          // Configurable, see typical pin layout above
#define LED_ROUGE        5         // Configurable, see typical pin layout above
#define BUZZER           2          // Configurable, see typical pin layout above
LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);
MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance
Servo myServo;//define // define serov name
 
void setup()
{
 
  lcd.begin(16,2);
  lcd.clear();
  lcd.setCursor (0,0);
  lcd.print("SCANNER LA CARTE");
    Serial.begin(9600);     // Initialize serial communications with the PC
    SPI.begin();            // Init SPI bus
    mfrc522.PCD_Init();     // Init MFRC522
  myServo.attach(3); // servo pin
  myServo.write(0);//servo start position
  pinMode(LED_VERT,OUTPUT);
  pinMode(LED_ROUGE,OUTPUT);
  pinMode(BUZZER,OUTPUT);
  noTone(BUZZER);
// Serial.println("Approcher votre Carte pour le scan");
 //Serial.println();
}
 
void loop()
{
  static String content;
  static bool newCard=false;
 
  // Look for new cards
  if (mfrc522.PICC_IsNewCardPresent())
  {
    // Select one of the cards
    if (mfrc522.PICC_ReadCardSerial()) {
      // SHOW ID SERIAL
      //Serial.println("UID tag : ");
      byte letter;
      content="";
      for (byte i = 0; i < mfrc522.uid.size; i++)
      {
        //Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
        //Serial.print(mfrc522.uid.uidByte[i], HEX);
        content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
        content.concat(String(mfrc522.uid.uidByte[i], HEX));
        content.toUpperCase();
       
      }
      Serial.println(content.substring(1));
      //Serial.println();
      //Serial.println("Message : ");

      newCard=true;  // on a une nouvelle carte à traiter
    }

       
  }
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("SCANNER LA CARTE");
        lcd.setCursor(0, 1);
        lcd.print(content); // l'affiche se limite ici juste apres l'affichage de content   
       

  if (Serial.available())
  {
    data = Serial.read();
    //Serial.print(data);
       lcd.clear();
       lcd.setCursor(0, 0);
    if (data == 'A')
    {
      //Serial.println("ok"+content.substring(1));
      lcd.print("Acces Autorise");
 
      delay(500);
      digitalWrite(LED_VERT, HIGH);

      tone(BUZZER, 1500);
      delay(300);
      noTone(BUZZER);
      myServo.write(180);
      delay(5000);
      myServo.write(0);
      digitalWrite(LED_VERT, LOW);
    }
    else
    {
      lcd.print("Acces Refuse");
      digitalWrite(LED_ROUGE, HIGH);
      tone(BUZZER, 5000);
      delay(1000);
      digitalWrite(LED_ROUGE, LOW);
      noTone(BUZZER);

    }
    newCard=false;          // carte traitée
  }
  //delay();
}
16
I have been attempting to build a self leveling platform. For way too long
SOOO disguised.
It only needs to turn on 1 axis,  ( X )
I am using an Arduino UNO board
I have a ADXL345 by Adafruit
I am using a DSSERVO DS 3218 PRO
Enclosed is the code directly from the Adafruit website
https://learn.adafruit.com/adxl345-digital-accelerometer/programming
I run the program while hooked up to the USB port on the PC & it works.
I would really like to increase the sensitivity ( I believe )
Sometime while rotating, the servo reacts, but sometime very slowly
Could anyone PLEASE try to assist me. If any advice is given, I need detailed advice being am at the end
ANY and ALL help would be forever grateful
Thank you
Jerome


/*
 * Accelerator demo
 *
 */
#include <Servo.h>
#include <Adafruit_ADXL345_U.h>

// Create servo objects for x and y servos
Servo xServo;
Servo yServo;

// Used to level the platform, if needed
int xOffset = -7;
int yOffset = -1;

// Used to decrease sensitivity
int sensitivity = 50;

// Assign a unique ID to this sensor at the same time
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);


void setup() {
      Serial.begin(9600);
 
// Initialize sensor
      if(!accel.begin())
      {
// Sensor not detected
            Serial.println("No Sensor detected");
      while(1);

      }

// Connect servos to pins
      xServo.attach(9);
      yServo.attach(10);

// Setup sensor Range and datarate
      accel.setRange(ADXL345_RANGE_16_G);
      accel.setDataRate(ADXL345_DATARATE_25_HZ);

}

void loop() {
 
      sensors_event_t event;
      accel.getEvent(&event);

// Get x and y values from sensor
      int x = event.acceleration.x;
      int y = event.acceleration.y;

// map sensor value (-10 - 10) to servo position value (30 - 150)
      int x1 = map(x, -10, 10, 130, 50);
      int y1 = map(y, -10, 10, 50, 130);

// Troubleshoot info - show sensor reading and mapping
      Serial.print("X: "); Serial.print(x);
      Serial.print("\tY: "); Serial.print(y);
      Serial.print("\tX1: "); Serial.print(x1);
      Serial.print("\tY1: "); Serial.println(y1);

// move servos based on sensor mapping
      xServo.write(x1 + xOffset);
      yServo.write(y1 + yOffset);
      delay(sensitivity);         //delay to decrease sensitivity
}
17
Project Guidance / Re: 3D printed Wind Tunnel wit...
Last post by wvmarle - Today at 06:39 pm
What do you mean by application notes?
Documents written by the manufacturer about how to use their product. Bosch very likely has application notes related to the BME280 (and related BMP280 and BMP180) giving you suggestions on how to use them.

Measuring the pressure of a moving fluid such as air is VERY difficult. No surprise you get great results in static air, but noisy values all over the place when it's moving.
The moment you have air flow over the end of a tube (tube vertical, air flow horizontal) the pressure inside the tube drops, even if the pressure outside doesn't change at all. Change the orientation of that tube in the same air flow and same air pressure, and the pressure inside the tube changes.
Now look at your BMP280, you will see this tiny hole. That's similar to this tube. So when air flows over the sensor the pressure it measures depends on how it's oriented in the flow. Very likely your flow is turbulent as well, and that will give a lot of noise in the readings. You mentioned 3D printing the parts, so the walls will be rough adding more turbulence.
For any chance of accurate readings you have to talk to people that are specialised in wind tunnels, pressure measurements, etc. They will at least be able to tell you what the problems are and ways to overcome them. Not much chance to find those folk on this forum... I also only know just enough to know it's not exactly straightforward.
18
Software / LCD 20×4
Last post by vincenzO88 - Today at 06:38 pm
Salve, vorrei cominciare un progetto dove mi interesserebbe avere nel display lcd 20×4, il disegno di una batteria (come quella che si trova nel display di ogni smartphone). Spero possiate aiutarmi...
19
Programming Questions / Re: trouble with code: sending...
Last post by pert - Today at 06:38 pm
Did you try following my instructions?
20
Deutsch / Re: Unterschied bit schieben o...
Last post by ElEspanol - Today at 06:36 pm
das kann schon sein. Also bist du auch der Meinung, dass das dasselbe Ergebnis bringen müsste?

Und ich weiss, der fehlerbehaftete Teil ist in dem nicht gezeigten Teil des Sketches.
Pages: 1 [2] 3 4 ... 10