New answers tagged

0

Building on P_B's answer to pack additional data types, I extended the python as follows. Of course, the receiving Arduino code needs to receive into the correct data type as well. def StuffInt(txfer_obj, int_to_send, start_pos=0): """Insert integer into pySerialtxfer TX buffer starting at the specified index.""" return StuffObject(txfer_obj, ...


1

It would be easier if you used Arduino <--> Python compatible libraries to ensure the communication between the two is robust and reliable. An example of such libraries would be pySerialTransfer and SerialTransfer.h. pySerialTransfer is pip-installable and cross-platform compatible. SerialTransfer.h runs on the Arduino platform and can be installed ...


1

After some struggle I figured out that I need to add my user to "tty" group as well. There's another approach that involves udev rules modification for certain vendor:device and update of device's ownership but this seems more sane approach. To recap: Add your standard user to the group "dialout' sudo usermod -a -G dialout your-username Add your ...


1

As you ask for two different assignments for the same var its never gone to work this way. Two quick options: Do binary addidition failflag = 0; if(errorA) failflag += 1; if(errorB) failflag += 2; if(errorC) failflag += 4; if(errorD) failflag += 8; //then you can decode combined errors as follows else if (failflag == 13) { Serial.println("Errors: ...


5

(failflag == 5) && (failflag == 1)) failflag can't be both 5 and 1 at the same time.


2

There is a simple library that works for FT5xx6 display panel. Other information available: Application node - https://cdn-shop.adafruit.com/datasheets/FT6x06_AN_public_ver0.1.3.pdf Datasheet - https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf In case those links might be no longer available in the future, a quick search on ...


1

As far as I can tell from the picture you share that you don't have an external power supply connect to the shield to drive the "12 DC motors". Read https://learn.adafruit.com/adafruit-motor-shield/power-requirements for better understanding on how to power the motors.


0

You are probably trying to load your code using Tools -> Burn Bootloader. Instead, you should use Sketch -> Upload, or shortcut CTRL + U or using the upload button:


1

The devil is in the details. From the PrintEx repo doc, this is the formatting for printf: %[flags][width][.precision][length]specifier When you use long, you will have to provide the [length], and the lib only accepts "l" (Letter L). #include <PrintEx.h> long int Fin1 = 5; long int Fin2 = 2; float SteeringValue = 3.5; void setup() { Serial....


1

You've run into a classic trap. There are a couple of things to think about. First off, if this is a singleton class (as in there will only ever be one instance) then you can just have a non-member function that you use with attachInterrupt and have that function just call the member function you want. Normally what I would do would be to create the ...


1

Adafruit has a V1 and a V2 motor shield. They have different libraries too. AFMotor.h is for the V1 shield. From the error, I can tell you installed V2 lib. For that you need to include: #include <Adafruit_MotorShield.h>


0

See my post https://www.fpaynter.com/2020/03/arduino-spi-data-exchange-between-two-arduinos-in-a-master-slave-configuration/ for a newbie's take on the problem


2

You never reset your b pointer. The first time through it works its way through the memory reserved for buf. The second time through your loop it's already at the end of that memory and you then start incrementing (and filling) past that overwriting other variables - the first of which sounds like it might be n - so *b++=data is writing data (245) to n. You ...


0

Yes. Using i2c, you need to change the address of the MPU6050 because the default is (0x68) which is also the default and only address the DS3231 can use. Example of changing the address from a personal sketch: MPU6050 mpu(0x69); So try: MPU6050 accelgyro(0x69);


1

The SmartInventor library is to be used with the Rokit Smart board. That board is based around the ATMega32. The Arduino Mega is not a Rokit Smart board, so the library will not work, since the Arduino Mega us based around the ATMega2560. The two chips are different, and have different sets of internal peripherals. So the registers have different names ...


0

#include <Keypad.h> char myNum[4]; const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad 8,7,6,5 byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the ...


1

While it is true that your loop is incorrect, the coding error is unlikely to cause the behaviour that you have described. Please ensure that a current limiting resistor is placed in series with each LED. Since you have 14 LEDs, you will need 14 current limiting resistors. 470 Ohm resistors (or similar) should be adequate for this purpose. As per the other ...


0

your for statements with r=1 need to be changed to r=0;r<14 Arrays always start with the first item being 0, so yours is 0 to 13.


0

The solution is, You need to implement custome pulse in funtion unsigned long rdPulseIn(int pin, int value, int timeout) { // the following comments assume that we're passing HIGH as value. timeout is in milliseconds unsigned long now = micros(); while(digitalRead(pin) == value) { // wait if pin is already HIGH when the function is called, but ...


0

The Arduino builder doesn't create forward declarations of functions for functions used in code as callbacks. It has something to do with the occurrence of the name without the usual form of function call. You could move the function rtcTime before setup() so it is visible for the use as parameter in attachInterrupt or you can create a forward declaration ...


Top 50 recent answers are included