New answers tagged

2

I do not know how to interpret the data given by that sensor, but from reading the code, the meaning of dt is pretty clear. The function you show assumes that the sensor started in the reference orientation (quaternion one), then rotated at a constant angular velocity until it reached the current orientation (quaternion *this), and this rotation happened ...


1

I've configured the timer differently making use of its UserData property. The timer will update the data every fixed period for a specified number of samples. close all; clear all; % Some useful constants. NUM_SAMPLES = 20; PERIOD = 0.05; global a; a = arduino('com4', 'uno'); % Initialise data. It will be updated by the timer. data.i = 0; data.v1 = zeros(...


0

By shining with a bright light through the PCB, I came up with this reverse-engineered circuit diagram. From my understanding, the IC is some sort of special OP amp. I suppose one can change the timing by adjusting the 154 (150k) resistor and the sensitivity by adjusting the 335 (3.3Meg) and/or the 103 (10k) resistor.


4

Your breadboard is one of those which have the power/GND lines interrupted between columns 31 and 33. I also once fell into this trap. If you look closely, you see that the blue and red lines are interrupted in the middle of the board. Just put wires between these pins to bridge the gap.


1

Next update with 3.1 of the library, you need to call irrecv.decodedIRData.decodedRawData to get the data. This code worked for me: #include <IRremote.h> int IRpin = 11; IRrecv irrecv(IRpin); void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode()) { Serial.println(irrecv....


1

As a couple people already pointed out, you're using for loops that are unnecessary, and will cause you to get the wrong measurements. You're better off just using myservo.write(); to set your servo to positions 0 and 180. Additionally you never check to see if there's an obstacle infront of your robot. Instead, your robot immediately tries turn right or ...


0

You just need a global variable to track whether it is done or not like this... // other Codes bool State=0; void setup(){ // other Codes... } void loop(){ if(distance <= 150 && State==0){ personPresent(); // This function should get executed only once State=1; }else if(distance>150 && State==1){ personAbsent(); // This sould ...


3

I would consider placing a light sensor close to one of the lights to signal when the lights are on. Placement is critical as you do not want a signal when the lamp is off. I am assuming they are permanent light fixtures and you are not allowed to tamper with the wiring. Record the elapsed time when they are on. Note the start time and then subtract that ...


-2

#include <LcdKeypad.h> #include <LiquidCrystal.h> #include <Wire.h> // For I2C //Set the pins on the I2C chip used for LCD connections //ADDR,EN,R/W,RS,D4,D5,D6,D7 LcdKeypad lcd(0x3f, 2, 1, 0, 4, 5, 6, 7); // 0x27 is the default I2C bus address of the backpack-see article #define echoPin 3 // Echo Pin (OUTPUT pin in RB URF02) #define ...


1

This is a resistive sensor and "plain" water is not infinitely conductive. In fact, pure or distilled water is a very poor conductor. Also, "plain" water - tap water, I assume - will vary in its dissolved solids, not only from source to source, but likely over time, too, for some sources and it is these solutes that are responsible for ...


2

This video might help you, in this video, an Indian guy explained the issue in detail with the help of the max30100 sensor schematic diagram, and solved it in two ways. https://youtu.be/ZqdmA4NAqb0


Top 50 recent answers are included