Search found 929 matches

by mnf
Wed Apr 14, 2021 7:16 am
Forum: General Programming
Topic: Draw a circle using 2 stepper motors
Replies: 3
Views: 178

Re: Draw a circle using 2 stepper motors

That's an interesting idea. Of course the simplest way to draw a circle with two motors is to just use one of them :D If you use two motors you will have to combine horizontal and vertical steps - using an algorithm such as https://www.google.com/url?sa=t&source=web&rct=j&url=https://web.engr.oregon...
by mnf
Sun Apr 04, 2021 4:54 pm
Forum: Programming Tips & Tricks
Topic: Interface board for Flowcode V8 and above. Now added RTC
Replies: 33
Views: 3582

Re: Interface board for Flowcode V8 and above. Now added RTC

Just been experimenting with i2c on the interface board. Can't get it to work reliably - initially I used wi-fi and sometimes results would be correct - other times just 0 returned from i2c reads. Tried with USB and again sometimes results correct / sometimes not... Reading multiple (128) bytes from...
by mnf
Sat Apr 03, 2021 6:44 pm
Forum: User Components
Topic: New led string to play with. SK6812 - rgbw
Replies: 10
Views: 552

Re: New led string to play with. SK6812 - rgbw

And a datasheet (which seems to show the layout as RGBW) https://cdn-shop.adafruit.com/product-files/2757/p2757_SK6812RGBW_REV01.pdf To confuse the issue - they are also available in RGB form - which accept 24 bit colour (GRB as per ws2812) https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED...
by mnf
Thu Apr 01, 2021 11:59 am
Forum: User Components
Topic: New led string to play with. SK6812 - rgbw
Replies: 10
Views: 552

Re: New led string to play with. SK6812 - rgbw

Hi Chad, Won't work as is then... The source for the ws2812 component is on the forum @ https://www.matrixtsl.com/mmforums/viewtopic.php?f=76&t=22045&hilit=ws2812 - along with my refresh code which should be easier to modify. Basically need to extend the data transmitted to 32bits (which will make t...
by mnf
Wed Mar 31, 2021 12:27 pm
Forum: User Components
Topic: New led string to play with. SK6812 - rgbw
Replies: 10
Views: 552

Re: New led string to play with. SK6812 - rgbw

Hi Chad, Just had an experiment with one of these. They take a 32bit value using the same timing as ws2812 leds. I modified my ATTiny85 ws2812 code to take a 32bit colour (note the ws2812 component has 24 bit color - no white - so would need modifying to have a 32 bit buffer. Here I just 'push' valu...
by mnf
Sun Mar 14, 2021 7:41 pm
Forum: User Components
Topic: Building Components - Step by Step Guide
Replies: 31
Views: 20935

Re: Building Components - Step by Step Guide

Looks an interesting project..

Good luck and keep us informed. I might have a go at making one if it works....

Martin
by mnf
Sat Feb 06, 2021 3:09 pm
Forum: Flowcode V8
Topic: Convert Int to a decimal number
Replies: 4
Views: 348

Re: Convert Int to a decimal number

Sorry - not at computer now.. but is your value a float?

Just looked and it's an integer value - you'll need a floating point value for your result...

Martin
by mnf
Fri Feb 05, 2021 8:43 pm
Forum: Flowcode V8
Topic: Convert Int to a decimal number
Replies: 4
Views: 348

Re: Convert Int to a decimal number

In a calculation use:

str = FloatToString$(value, 2) (or change 2 to required number of digits...)

Then print str.. (str defined a string variable..)

Martin
by mnf
Fri Feb 05, 2021 7:36 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 536

Re: Receive string uart rs232

Glad to hear you got it working. That bar graph - graduated display looks great!

This forum doesn't have a specific section - I've posted stuff in the 'hints and tips' section....
The new v9 forum has a specific area https://www.flowcode.co.uk/forums/viewforum.php?f=10

Martin
by mnf
Wed Feb 03, 2021 12:49 pm
Forum: General Programming
Topic: how to set or clear individual bits in a veriable??
Replies: 3
Views: 928

Re: how to set or clear individual bits in a veriable??

One way to do it is with '|' (or operator) or to clear bits '&' (and operator)

Code: Select all

x = x | (1 << 4)
will set bit 4

Code: Select all

x = x & ~(1 << 4)
will clear bit 4

To set a 'variable' bit

Code: Select all

x = x | (1 << n)
To set or clear multiple bits you can use a mask

Code: Select all

x = x | 0b11110000
will set bits 7..4

Martin
by mnf
Wed Jan 27, 2021 12:13 am
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 536

Re: Receive string uart rs232

A couple of ideas to try... In the first program: The max string length is limited to 10 chars (receive_pos = (receive_pos + 1) % 10 - receive_pos will go from 0..9 then back to 0 - so increase the 10 to allow for max length of string - might need to increase size of buffer (Data_string) too. What i...
by mnf
Tue Jan 26, 2021 1:19 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 536

Re: Receive string uart rs232

Hi Ronny,

Can you post your code to date? - and I'll try and see why it's just getting the tail of the string...

Martin
by mnf
Sun Jan 24, 2021 6:54 pm
Forum: Flowcode V8
Topic: Receive string uart rs232
Replies: 7
Views: 536

Re: Receive string uart rs232

Hi Ronny, The isCharWaiting function doesn't really have an equivalent in FC - what to do is to have an Rx interrupt that puts received characters into a circular buffer (either the FC component or a simple array and counter) There are examples here https://www.matrixtsl.com/mmforums/viewtopic.php?f...
by mnf
Mon Jan 18, 2021 8:00 pm
Forum: Feature Requests
Topic: Fast display ST7789!
Replies: 83
Views: 5566

Re: Fast display ST7789!

Progress - so far...

See https://youtu.be/1rtbY4XN9Tc

Martin
by mnf
Tue Jan 12, 2021 7:16 pm
Forum: Bug Reports
Topic: Clock setting
Replies: 3
Views: 345

Re: Clock setting

Thanks, yes it didn't seem to cause a problem - and gone in v9...

Martin
by mnf
Tue Jan 12, 2021 9:05 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 359

Re: Maximum String Length for 16 and 32-bit PICs

Something like: senddata.JPG Where data (an array - you can use any value in the parameter definition, data[2] for example - and then pass any size array (data[10000]). Also pass the length - as mentioned this will allow data arrays (including 0) - if you want to use strings (0 is termination charac...
by mnf
Tue Jan 12, 2021 8:56 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 359

Re: Maximum String Length for 16 and 32-bit PICs

Looking at the code generated... void FCD_05481_cal_uart__SendString(MX_CHAR *FCL_DATA, MX_UINT16 FCLsz_DATA) { //Local variable definitions MX_UINT8 FCL_IDX; MX_UINT8 FCL_LEN; So - in FC8 at least you will be limited to a maximum of 255 characters if you use SendString. Note this seems to be fixed ...
by mnf
Tue Jan 12, 2021 7:42 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 359

Re: Maximum String Length for 16 and 32-bit PICs

Are you actually sending a string or an array of data?

- in a string 0 marks the end of string. If it was an array of data then 0 might be a valid value - and you would typically also pass a length to.

Martin
by mnf
Tue Jan 12, 2021 6:39 am
Forum: Flowcode V8
Topic: Maximum String Length for 16 and 32-bit PICs
Replies: 5
Views: 359

Re: Maximum String Length for 16 and 32-bit PICs

Hi Brendan, Have a look at the c generated - if there is a X = str_len(str) type statement or an index while (str[X])... then the max length will be determined by the size of this and other variables if x is 8 bit then 255 characters is probably your lot. It would be easy to write a new routine usin...
by mnf
Mon Jan 11, 2021 4:32 pm
Forum: Bug Reports
Topic: Clock setting
Replies: 3
Views: 345

Clock setting

A visual bug. Using an ATTiny MCU (I tried 88 and 22 others maybe affected too) - set the clock speed to > max speed (so for I tried 16 and 32MHz) - this (correctly) says 'greater than max speed' - but then displays the 'loading targets' with whirly. This stays until clicking 'cancel' which gets rid...
by mnf
Mon Jan 04, 2021 8:00 pm
Forum: Flowcode V8
Topic: Referencing a ROM table in a C block
Replies: 3
Views: 289

Re: Referencing a ROM table in a C block

No problem...

Martin
by mnf
Mon Jan 04, 2021 7:21 pm
Forum: Flowcode V8
Topic: Referencing a ROM table in a C block
Replies: 3
Views: 289

Re: Referencing a ROM table in a C block

Hi Brendan,

The easiest way to check this is to define some code that does it and then look at the C generated..

For example in a calculation I do :

Code: Select all

.x = lut1::GetInt(2)
This 'expands to' (using customize C code or view C)

Code: Select all

FCL_X = FCD_00fb1_lut1__INTLIST(2);
Martin
by mnf
Mon Jan 04, 2021 6:20 pm
Forum: Programming Tips & Tricks
Topic: Recursion in Flowcode
Replies: 3
Views: 4330

Re: Recursion in Flowcode

Currently reading 'Algorithms Illuminated' by Tim Roughgarden - and first algorithm I tried to implement in Flowcode was Quicksort. This is a great sorting algorithm - quick (as the name suggests) and also light on memory use (although it can use a fair bit on recursion calls...) So - using a very n...
by mnf
Mon Dec 28, 2020 7:18 pm
Forum: Flowcode V8
Topic: Memory 24C64
Replies: 2
Views: 378

Re: Memory 24C64

I did a simple component for an i2c eeprom eeprom.fcfx - Which I've modified and used extensively since I posted it (above is a copy of the last posted version... (It's simplest and program rather than a component)) It should be fairly straightforward to get it to work with the 24c64 chip (note this...
by mnf
Sat Dec 26, 2020 6:11 pm
Forum: Bug Reports
Topic: ATTiny85 SPI
Replies: 8
Views: 663

Re: ATTiny85 SPI

Hi Ben,

Hope you had a good Christmas - any progress on this - it seems to affect all the chips with the USI interface.

Martin