Search found 1703 matches

by mnfisher
Fri Mar 20, 2026 1:54 pm
Forum: General
Topic: ESP32 UART-USB Brige How to use
Replies: 38
Views: 16887

Re: ESP32 UART-USB Brige How to use

Progress 👍

Do you get any output from the usb?

Martin
by mnfisher
Fri Mar 20, 2026 2:19 am
Forum: General
Topic: Creating a string to be used in a digital output statement
Replies: 1
Views: 58

Re: Creating a string to be used in a digital output statement

The easiest way to do this is with a little C.

For example for port d (assuming the pin is set as an output)

PORTD |= (1 << FCL_PIN);

Will turn on 'pin' without affecting other pins in port d

Martin
by mnfisher
Tue Mar 17, 2026 8:08 am
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

Hi Pierre,

Good to hear you have it working. Arrays are very useful - enjoy :-)

I'd be tempted to just use 0 as an invalid reading... then can just do if(.distance) which is slightly more efficient than if (.distance != 9999)


Martin
by mnfisher
Mon Mar 16, 2026 9:19 pm
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

Hi, Sorry to take so long getting back to this - a few days away... So - in the end I just wired a standard resistor (47K) across R19 (for mode 4). Less than elegant. I then wired to a UART (I used a software port on an Arduino for testing) - and fired off the trigger (1) at 20ms intervals. I connec...
by mnfisher
Fri Mar 13, 2026 2:57 am
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

I'm just waiting on some resistors to have a play.... In the UART modes it outputs the length as two bytes - in a 4 byte block (header, datahi, datalo, checksum) - the length is datahi * 256 + datalo So if we catch the data to an array d[4] it would be d[1] x 256 + d[2] The result is in mm The excep...
by mnfisher
Thu Mar 12, 2026 4:41 am
Forum: General
Topic: HexToDecimal
Replies: 4
Views: 543

Re: HexToDecimal

by mnfisher
Sun Mar 08, 2026 6:58 am
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

The component only seems to work with the compatibility mode.
The other modes are interesting too though - I'll try and add something to the board so I can easily switch the connection at r19 and play some more....

Martin
by mnfisher
Sat Mar 07, 2026 9:15 pm
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

I wrote a very simple program - that sends a trigger and then waits for a return pulse. It measures this using a loop with a 58us delay - and the results look reasonable. Note that the sensor has a minimum range of ~20cm and results go awry below this. The code here also has no time out - so if a re...
by mnfisher
Sat Mar 07, 2026 8:44 pm
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

The component 'attempts' to add an extra delay - delay 'type' but this is just 20us - the delay before the output pulse (on the board I have anyway) is 12.4ms

So it always 'time outs' the response.
by mnfisher
Sat Mar 07, 2026 8:29 pm
Forum: Projects - Embedded
Topic: AJ-SR04M Returning 9999 while using the AJ-SR04M Component
Replies: 17
Views: 2973

Re: AJ-SR04M Returning 9999 while using the AJ-SR04M Component

Wired up the sensor to an Arduino - and got 9999 (error). R19 open (mode 1 HCSR04 compatible) I added a connection to a logic analyser - and the output from the sensor looks good - there is a 'trigger' pulse - followed by an output pulse of variable length (depending on distance) However - the outpu...