search.noResults

search.searching

saml.title
dataCollection.invalidEmail
note.createNoteMessage

search.noResults

search.searching

orderForm.title

orderForm.productCode
orderForm.description
orderForm.quantity
orderForm.itemPrice
orderForm.price
orderForm.totalPrice
orderForm.deliveryDetails.billingAddress
orderForm.deliveryDetails.deliveryAddress
orderForm.noItems
Column: Electronics design


Setting up a Flowcode App Developer data logger


W


By Martin Whitlock, Applications Engineer, Matrix TSL


ith Flowcode’s App Developer it is very easy to create and store fi les on your local


hard drive. With in-built components such as the CSV writer, a fi le can easily be created and loaded into Excel for chart plotting and further analysis. With a Flowcode array of open-source API components, data can be pulled from real-world electronic hardware, such as a USB-connected Arduino Uno or a WiFi- connected ESP32, for example. We can use Flowcode’s basic analogue and digital input functionality, or do more complex tasks such as collecting sensor data via a bus – an I2 example.


C, OneWire, UART or SPI, for


Setup We start by creating a blank App Developer project by selecting ‘new project’ and then the ‘App Developer’ tab, then using the ‘Components Libraries’ toolbar and dragging a CSV Read/Write component from the Storage category and an API (ESP32) component from the API category. T e CSV Read/Write component has a


number of macros to write and read data to and from a fi le on the local hard drive. We must fi rst open a specifi c fi le using the macro OpenFile, which requires a fi lename to be entered, for example “log.csv”. In our App Developer project, we create a new property called “fi lename”, or type a line of text, which allows the app user to specify their own log fi les, as required.


T e OpenFile macro has a second


parameter, which is kept should the existing contents of the fi le be deleted when opening. Again, control over this is passed on to the user by creating another property type, this time with the choice of true or false:


We then call the OpenFile macro,


using the two property variables as macro parameters. We create a Boolean-type variable with name FileOK to store the return, which tells us if the fi le was created/ opened successfully:


Now that the log fi le is open, we can


add data to it by using the AddNumber or AddString macros. Calling these macros adds the specifi ed value to the fi le as an ASCII string of characters, followed by a comma, which automatically moves horizontally from column to column in the CSV fi le. When we want to move downwards onto a new row and back to the fi rst column we use the NextRow macro.


We give the property variable a default


value that will be used when the user fi rst loads the app:


12 November 2021 www.electronicsworld.co.uk T e only other macro we may need to


Page 1  |  Page 2  |  Page 3  |  Page 4  |  Page 5  |  Page 6  |  Page 7  |  Page 8  |  Page 9  |  Page 10  |  Page 11  |  Page 12  |  Page 13  |  Page 14  |  Page 15  |  Page 16  |  Page 17  |  Page 18  |  Page 19  |  Page 20  |  Page 21  |  Page 22  |  Page 23  |  Page 24  |  Page 25  |  Page 26  |  Page 27  |  Page 28  |  Page 29  |  Page 30  |  Page 31  |  Page 32  |  Page 33  |  Page 34  |  Page 35  |  Page 36  |  Page 37  |  Page 38  |  Page 39  |  Page 40  |  Page 41  |  Page 42  |  Page 43  |  Page 44  |  Page 45  |  Page 46