Category : arduino

I’m trying to communicate with an Arduino via serial with Python and I keep getting this error: >PS C:DevelopmentAllenInterface> python3 .test.py Traceback (most recent call last): File "C:DevelopmentAllenInterfacetest.py", line 11, in <module> ser.write([0, 0]) AttributeError: ‘Serial’ object has no attribute ‘write’ This doesn’t just happen with the write method, it also happens with read(). I’ve ..

Read more

The read bits from DHT22 sensor as follow: 0000000111010001000000001110111111101111 If we calculate the check sum of them by the formula that they gave: Reference: https://cdn-shop.adafruit.com/datasheets/Digital+humidity+and+temperature+sensor+AM2302.pdf If you convert each of their octets in the example to decimal and compare it with the last 8 bits (checksum) – they are equal. Binary: Decimal: 00000001 1 //First ..

Read more

My Serial is 9600 baud code: void setup() { } void loop() { Serial.begin(9600); Serial.println("Hi"); } I tried also use char array instead of string : const char test[100] = "Hi"; void setup() { } void loop() { Serial.begin(9600); Serial.println(test); } doesn’t work , first output : 02:42:33.759 -> U⸮⸮⸮⸮⸮ second output : 02:46:52.697 -> ..

Read more

I have following classes: class ATemperatureDevice{}; class AHumidityDevice{}; class BluetoothLeDevice{}; class Sensor1 : BluetoothLeDevice, ATemperatureDevice, AHumidityDevice {}; class Sensor2 : BluetoothLeDevice, AHumidityDevice {}; I have a vector<BluetoothLeDevice>, where all devices are stored. The Classes ATemperatureDevice, AHumidityDevice and BluetoothLeDevice have virtual functions. When I pick one, I have a BluetoothLeDevice. Now I want to check if ..

Read more

So I am doing a project which involves serial communication between a rsp and an arduino Uno. The code for spitting the string uses this line: sp = strchr(data, ‘ ‘); However my compiler chucks an error saying that sp is not declared in this scope. I tried to put it before the loops but ..

Read more