Search found 882 matches

by mnfisher
Thu May 02, 2024 8:53 pm
Forum: Projects - Embedded
Topic: PIC Random Nunber
Replies: 5
Views: 13

Re: PIC Random Nunber

The issue with Random() is that the resultant sequence will be the same on every run. Great idea from Iain to use a 'genuinely random number (possibly as a seed) - for example current time in ms or a floating pin.. You can do this with a C Block and srand(FCL_SEED); Where .seed is the value you want...
by mnfisher
Thu May 02, 2024 7:31 pm
Forum: Projects - Embedded
Topic: PIC Random Nunber
Replies: 5
Views: 13

Re: PIC Random Nunber

Flowcode had random() and you could use something like:

500+(random() % 3500) to generate time between 500 and 4000 then delay in ms...

Martin
by mnfisher
Mon Apr 29, 2024 9:16 pm
Forum: General
Topic: Esp32 Tasks - communication and control
Replies: 0
Views: 61

Esp32 Tasks - communication and control

A work in progress. The esp32 makes it easy to have multiple tasks performing different functions. For example a task could update an LED display when required. There are several options to communicate data to a task - for example to change the LED colour. For example there are queues, semaphores an...
by mnfisher
Mon Apr 29, 2024 8:12 pm
Forum: Projects - Embedded
Topic: COMPONENT MACRO RESET TIMER
Replies: 3
Views: 75

Re: COMPONENT MACRO RESET TIMER

Something is going wrong with the PrintNumber - which will only show a 16 bit value. I did a few things. 1) I removed the ResetTimer and Added 'true' to the StartTimer to reset it. 2) I added an .x = GetRawCount into the loop in main (to check the value was actually changing) 3) Then - I added a con...
by mnfisher
Mon Apr 29, 2024 7:59 am
Forum: General
Topic: 9bit UART - Arduino Mega 2560
Replies: 9
Views: 163

Re: 9bit UART - Arduino Mega 2560

It does work - so I guess the 'hint' hasn't been updated. (As mentioned the component used to work with bytes) Note - Use the Rx interrupt - data has been received (so it should never timeout?) I don't know what timeout would return in this case (but if you only receive single character in the inter...
by mnfisher
Mon Apr 29, 2024 7:19 am
Forum: General
Topic: Do I need this pin? ST7789 DC pin?
Replies: 3
Views: 81

Re: Do I need this pin? ST7789 DC pin?

The display does use a D/C pin (to select data or command)
They have maybe missed it from the diagram?
by mnfisher
Mon Apr 29, 2024 7:10 am
Forum: General
Topic: 9bit UART - Arduino Mega 2560
Replies: 9
Views: 163

Re: 9bit UART - Arduino Mega 2560

Sorry - missed a '.' - I meant 0..511 (or 0 to 511) Which version of Flowcode are you using - the components used to only return a byte (8bit) - in version 10 (free !) - the Send/Receive Char take an int (16bit) of which they send/receive the appropriate number of bits... Did you manage to get my de...
by mnfisher
Sun Apr 28, 2024 10:18 pm
Forum: General
Topic: 9bit UART - Arduino Mega 2560
Replies: 9
Views: 163

Re: 9bit UART - Arduino Mega 2560

Note - could possibly have done the send and receive on the same Mega. I didn't think of it beforehand... I powered the second board from the first as I couldn't lay my hand on 2 of the Type A USB cables (though they are surely hiding somewhere) Windows terminal programs don't support 9 bit data (th...
by mnfisher
Sun Apr 28, 2024 9:43 pm
Forum: General
Topic: 9bit UART - Arduino Mega 2560
Replies: 9
Views: 163

Re: 9bit UART - Arduino Mega 2560

A quick demo of 9 bit comms using 2 Arduino Megas. One is the 'sender' (S) and one a 'receiver' (R) (I called it UART) (that echoes the received data to a PC via the USB comms UART) I connected RX1 to TX1 and TX1 to RX1 on boards 'S' and 'R' - also GND (essential) and 5v as I have the sender powered...
by mnfisher
Sun Apr 28, 2024 12:30 pm
Forum: General
Topic: 9bit UART - Arduino Mega 2560
Replies: 9
Views: 163

Re: 9bit UART - Arduino Mega 2560

... There is an issue - send and receive take a byte which is 8 bits, so some extra work needed..

- I might be wrong on this - looks like the functions now return an int.