Close

Transcript

A event log for Making Programming Easier

We'll be learning how to program microcontrollers in a new way in this chat. Bring your Arduino!

lee-wilkinsLee Wilkins 05/25/2018 at 20:130 Comments

Boian Mitov

3:01 PM

Hello @Lindy Thank you for organizing this :-)

In the meantime, you can all put your questions here > https://hackaday.io/event/158266-making-programming-easier and @Boian Mitov could give us an introduction?

Stephen Tranovich

3:02 PM

Yeah, thanks for hosting this one, Lindy!

Tx_Flashjoined the room.

3:02 PM

Boian Mitov

3:02 PM

Well... to make the story short... I am very lazy person :-D

Boian Mitov

3:03 PM

So I don't like to spend a lot of time writing code if I can do it easier :-D

Boian Mitov

3:03 PM

So I have this constant drive to find ways to program stuff easier, faster and with less maintenance

RoGeorge

3:03 PM

Making programming easier: Breed better humans!

:o)

Boian Mitov

3:03 PM

:-D

Boian Mitov

3:04 PM

I mean I am very frustrated with the general state of the SW industry

Andrew Davisjoined the room.

3:04 PM

Boian Mitov

3:04 PM

We are still using programming methods that are now I think over 200 years old

Boian Mitov

3:05 PM

We need to find better ways, especially with the rapidly changing and evolving world of "computing"

Christopher Bero

3:05 PM

Something being old doesn't make it bad

Boian Mitov

3:05 PM

and when I say "computing" I do not mean only CPUs

Boian Mitov

3:05 PM

but GPS, FPGAs as well as clusters, and clouds

Non-ICE

3:05 PM

python code publishe

Non-ICE

3:05 PM

d

Boian Mitov

3:06 PM

so this is the short story :-D

Great! We're super excited to have you. We'll get started with some questions.

Boian Mitov

3:07 PM

Than you! :-)

19-rsn-007joined the room.

3:07 PM

Question from @Stephen Tranovich "Are there any problems or algorithms which lend themselves more readily to visual programming versus tradition text based programming? Are there any problem or algorithm types which are more challenging to tackle with visual programming?"

Boian Mitov

3:08 PM

Well... there are no problems that can't be solved easier with graphical programming, but I hate the word "algorithm"

Boian Mitov

3:08 PM

algorithms are sequential by nature and very inefficient for modern computing

Boian Mitov

3:08 PM

I think they should be banned at some point :-D

Boian Mitov

3:08 PM

I avoid using algorithms as much as I can

Stephen Tranovich

3:09 PM

hah!

Boian Mitov

3:09 PM

even in text based programming I almost never use algorithms any more

Non-ICE

3:09 PM

thats easy, just boss other people around to write your code

Boian Mitov

3:09 PM

:-D

Boian Mitov

3:09 PM

I like writing my own code ;-)

anfractuosity

3:10 PM

i thought algorithm is just a fairly generic term? which would encompass serial/parallel solutions?

Boian Mitov

3:10 PM

if someone else writes it with algorithm it will be slow and inefficient

Boian Mitov

3:10 PM

no, algorithm is specific to sequential execution, at least in contemporary terminology

Stephen Tranovich

3:11 PM

I thought it was a generic term as well, whoopsies

anfractuosity

3:11 PM

are you sure, as people talk about quantum algorithms etc. too

Boian Mitov

3:11 PM

modern computing executes for most parts if variety of parallel execution forms

Boian Mitov

3:11 PM

and sometimes in FPGA

Boian Mitov

3:12 PM

so algorithm can't translate efficiently for FPGA as example

Boian Mitov

3:12 PM

dataflow representation can

Boian Mitov

3:12 PM

so the problem is less of graphical vs. text based

Boian Mitov

3:12 PM

and more in terms of sequential or dataflow/processing representation

Andrew Davis

3:13 PM

So what do you use to do a specific or repetitive task if not an algorithm?

Boian Mitov

3:13 PM

A block representing the task ;-)

Boian Mitov

3:14 PM

The task is performed over some data or IO

Boian Mitov

3:14 PM

so the task is not "repetitive" it simply happens as soon as there is new data

Boian Mitov

3:14 PM

You can think of it as a process within OS

Boian Mitov

3:14 PM

typical example

Boian Mitov

3:15 PM

in Arduino if you want to blink LED you put code to turn on wait turn off wait and loop

Boian Mitov

3:15 PM

good now you blink LED in repetetive task

Boian Mitov

3:15 PM

the problem is what happens if you need to blink another LED 3.7 times faster at the same time

Boian Mitov

3:15 PM

now what

Boian Mitov

3:15 PM

?

Boian Mitov

3:16 PM

The issue is that you don't want a loop, you want to blink LED

Boian Mitov

3:16 PM

so you unnaturally translated the need to have a blinking "task" into a loop because that's what the language offered

Boian Mitov

3:16 PM

but really you wanted a "task" that blinks the LED

Boian Mitov

3:17 PM

In Visuino you add a pulse generator, connect it to LED and it starts blinking

Boian Mitov

3:17 PM

if you want to blink another LED you add another generator

Boian Mitov

3:17 PM

set the frequency and it starts blinking

Jon Raymond

3:17 PM

Well I just learned via google search "visuino" and "visduino" are entirely different ends of the spectrum.

Boian Mitov

3:17 PM

and you keep adding stuff as needed

Boian Mitov

3:18 PM

:-D

Andrew Davis

3:18 PM

same board, multiple blink rates?

Stephen Tranovich

3:18 PM

haha @Jon Raymond

Boian Mitov

3:18 PM

yes

Boian Mitov

3:18 PM

same board different blink rates

Chris Ryding

3:18 PM

Sounds like event-driven programming

Boian Mitov

3:18 PM

yes it is actually

Boian Mitov

3:19 PM

dataflow programming and event driven programming have a lot of simularities

Boian Mitov

3:19 PM

Visuino does both together ;-)

>span class="s8">@Liam Kennedy has a question that might be a good starter before we get too into the technical "As someone who is new to the Arduino world.. who wants to get in to ESP8266 / ESP32 can you give me any "newbie" tips to getting in to that world with Visuino?  I'm looking to query web api's (JSON) and display stuff on attached OLED displays and flash "neopixel" RGBs.  I have some basics working using the OLD paradigm (Arduino IDE).. so interested how quickly I can jump to YOUR method"

Boian Mitov

3:20 PM

@Liam Kennedy You can start with something really simple like this:

https://www.instructables.com/id/Remote-Wi-Fi-DHT11-Temperature-an-Humidity-I2C-2-X/

Boian Mitov

3:20 PM

And then do something like this:

Jon Raymond

3:20 PM

Hold on the ESP32 as setting up the toolchain is still more complicated than I think it should be. ESP8266 toolchain is quite well developed now.

Boian Mitov

3:20 PM

https://www.instructables.com/id/ESP8266-and-Visuino-DHT11-Temperature-and-Humidity/

INSTRUCTABLES.COM BOIANM

 

ESP8266 and Visuino: DHT11 Temperature and Humidity Web Server

Hi BoianM, I'v a problem with visuino is that after uploading my Arduino generated code I can't get anything in dht11server on my PC's google web browser.

Read this on Instructables.com

Boian Mitov

3:21 PM

And finally this:

https://www.instructables.com/id/ESP8266-and-Visuino-DHT11-Temperature-and-Humidity/

Boian Mitov

3:21 PM

Visuino supports both ESP8266 and ESP32

Boian Mitov

3:22 PM

and adds some goodies missing from the ESP32 toolchain such as Servo support and PWM ;-)

Boian Mitov

3:22 PM

Since I write all the libraries for it anyway :-D

Frank Buss

3:22 PM

how do you implement arrays with it, like if you want to calculate prime numbers with the sieve of Eratosthenes, or Game of Life etc. ?

Lets try to keep questions psoted to the discussion here please > https://hackaday.io/event/158266-making-programming-easier

Liam Kennedy

3:23 PM

Yeah.. I started with the unit's here-> https://github.com/ThingPulse/esp8266-weather-station

Boian Mitov

3:23 PM

One interesting aspect of what I mentioned of the 2 LED blinkings is that the Visuino design can in theory be programmed in FPGA as well... so I am working toward supporting FPGAs too at some point ;-)

Boian Mitov

3:23 PM

Visuino supports arrays too :-)

Liam Kennedy

3:23 PM

Thanks for the links

Boian Mitov

3:25 PM

@Stephen Tranovich

Another from @Stephen Tranovich " So Visuino takes blocks, translates it into embedded C or Arduino language and uploads that info to the Arduino? I suppose my question is: Is Visuino built "on top" of the traditional coding languages and therefore has to be translated back to them before it is used?"

Stephen Tranovich

3:26 PM

Whoa, FPGA support PLEASE!

Boian Mitov

3:26 PM

Yes, very interesting question :-) And the answer is that Visuino is the same as C++ :-) C++ compiles to Assembler, Visuino compiles to C++

Boian Mitov

3:26 PM

So in essence everything is compiled down to assembler

Stephen Tranovich

3:27 PM

So it goes Visuino -> C++ -> Assembly

Boian Mitov

3:27 PM

what is interesting is that the same Visuino design when compiled for different board generates a different C++ optimizing it for the specific hardware

Stephen Tranovich

3:27 PM

-> board

Jon Raymond

3:27 PM

how big is the Visuino user base currently?

Stephen Tranovich

3:27 PM

Wow, that is cool

Boian Mitov

3:27 PM

exactly the same way as C++ compiles to specific assembler per processor

Frank Buss

3:27 PM

but sounds like this is not optimal. C is sequential and visuino is parallel, right?

anfractuosity

3:28 PM

you can do threads in C ;)

Lets try to keep questions posted to the discussion here > https://hackaday.io/event/158266-making-programming-easier

Frank Buss

3:28 PM

@lindy was the same question, but about more details :-)

Boian Mitov

3:28 PM

The user base is about 36000 at the moment, at least based on the registered accounts. Registration is optional however so it can be bigger

Boian Mitov

3:29 PM

Visuino will also use interrupts when applicable :-)

Stephen Tranovich

3:29 PM

That's epic!

Boian Mitov

3:29 PM

Visuino generates code to handle interrupts if the pin where the module is connected supports it

Boian Mitov

3:30 PM

so the same module will generate different code when connected to interrupt or non interrupt pin

Boian Mitov

3:31 PM

in multiprocessor systems, Visuino tries to use the multiple cores for the execution :-)

Boian Mitov

3:31 PM

And I am constantly improving the code generation

Boian Mitov

3:31 PM

It already generates code that is on average more optimized than the typical developers code, and I am pushing for much more :-)

Frank Buss

3:32 PM

but in C I have more control about e.g. interrupt priority, this is all lost in translation then

Jon Raymond

3:32 PM

Does Visuino use direct port manipulation or does it build with arduino's digital/analog write etc?

A question from @Lutetium  "Can Visuino be used for any Arduino based boards?  "

Boian Mitov

3:34 PM

Visuino was initially developed only for Arduino boards :-)

Boian Mitov

3:34 PM

So yes, it supports them very much all

Boian Mitov

3:34 PM

now it supports many more controllers

Andrew Davis

3:35 PM

is there any version of arduino that it works with better than others?

Boian Mitov

3:35 PM

Sometimes it uses the direct port manipulation, and sometimes the analor/digital read/write

Boian Mitov

3:35 PM

again it makes the decision on design by design cases

Boian Mitov

3:35 PM

and in some cases it uses the intreeupts

Andrew Davis

3:35 PM

or does that have more of a task based answer

Another from @Liam Kennedy  " Just checking how Visuino supports boards/add-ons (like OLED displays).. do YOU build all the libraries to support programming for that?  If that's the way it works - how do we find out which boards/components are supported?"

Boian Mitov

3:36 PM

it also is designed so most modules can be connected to GPIO I2C SPI etc. expanders as well as to the main board pins

Boian Mitov

3:37 PM

Practically all the libraries are developed by me for now. There are couple of other people that have developed some components, and I posted tutorials on component development

Boian Mitov

3:37 PM

I am working to make the component development itself an easy visual process

Boian Mitov

3:37 PM

the best way is to download Visuino and see if there is component for your device

Boian Mitov

3:38 PM

Black and White OLEDs are supported

Boian Mitov

3:38 PM

I am adding support for color OLEDs now

Boian Mitov

3:38 PM

xome color TFT displays are also supported

Boian Mitov

3:39 PM

if a device is not supported you can contact me and I will see what I can do to sneak in support for it ;-)

>span class="s8">@leb9049 "There are many ways to achieve the same thing in programming, the “pulse generator” for example, I would implement this differently depending on other requirements and resources needed for a projects as well as how accurately I need these pulse. If I have a hardware timer available and really need some accurate pulses I'd use that. It seems like any abstraction layer, even the layer that the Arduino IDE provides allows you to gloss over some details, which can be handy, but I’ve seen many people that didn’t knowing what is going on under the hood with an arduino go to a lot of trouble to implement something when one layer down it would have been a lot easier, simpler, and quicker to solve.

Is there a way to dig deeper when it's required or are you stuck in the sandbox?"

Boian Mitov

3:39 PM

Sometimes if I don't have the device and someone needs support for it, I expect them at least to get me the device so I can tyest with it ;-)

Boian Mitov

3:40 PM

@leb9049 Well... this is the same type of argument as C++ vs Assembly language

Tebjan Halmjoined the room.

3:41 PM

Liam Kennedy

3:41 PM

>span class="s3">@Boian Mitov - Downloading

Jon Raymond

3:41 PM

Is there a full list of supported boards? I don't see any SamD21/D51 boards listed?

Boian Mitov

3:41 PM

This is exactly the argument I had with people ~25 years ago when I moved to C/C++ development and others ware pusing for Assembler

leb9049

3:41 PM

I can still reach the registers from c++, can you with Visuino?

Boian Mitov

3:41 PM

the easiest way to see the current list of boards is to run Visuino and double click on the Arduino component

Boian Mitov

3:41 PM

it will open the list of boards

Boian Mitov

3:42 PM

Well... there is also the experimental Visuino Pro - now in Beta

from @nwmaker and @Lutetium "It sounds like Visuino can support a variety of hardware. What is the process for configuring your hardware situation like? / How does Visuino get the board specifics? "

Frank Buss

3:42 PM

and I can do inline assembler in C, Visuino should have inline C then as well

Boian Mitov

3:42 PM

It allows you to write pieces of code in C++ to be executed at specific time or over specific data ;-)

Boian Mitov

3:43 PM

So yes with the Pro version you can access registers if you wish, and it will come with the same price as when you inject assembly code in C++ ;-)

Boian Mitov

3:44 PM

@nwmaker and @Lutetium I map the boards one by one with their specific capabilities pin by pin ;-)

Boian Mitov

3:45 PM

One of the benefits of this is that you actually can see what your board can do right away as soon as you select it :-)

Cool! We have about 15 minutes left, did you want to take this time to show us some examples @Boian Mitov  ?

Boian Mitov

3:46 PM

Here is a mapped ESP32 LoRa Heltec board

Boian Mitov

3:46 PM

 

Boian Mitov

3:46 PM

You can see that it has Hall sensor, display, WiFi and LoRa :-)

Boian Mitov

3:47 PM

You want some demo ?

Liam Kennedy

3:47 PM

YES

yeah!

Stephen Tranovich

3:47 PM

YEAH

Liam Kennedy

3:47 PM

I've seen you demo at the Supplyframe. but that was a long time ago

Boian Mitov

3:48 PM

So here is how we can see the values from analog pin:

Boian Mitov

3:48 PM

 

Non-ICE

3:48 PM

how often will that happen

Non-ICE

3:48 PM

asap? and repeat?

Boian Mitov

3:49 PM

3 pulse generators on 3 pins:

 

Boian Mitov

3:49 PM

 

19-rsn-007

3:49 PM

I think this this Visuino stuff is great development

19-rsn-007

3:49 PM

great to get people started that have no programming experience

Boian Mitov

3:50 PM

Now the frequency of one of the generators is controlled with analog pin ;-)

Boian Mitov

3:50 PM

 

Non-ICE

3:50 PM

i must admin i realized i have visuino installed without a license after joining thit hackchat ;)

Non-ICE

3:50 PM

admint*

Non-ICE

3:50 PM

admit*

Non-ICE

3:50 PM

software VCO

Stephen Tranovich

3:50 PM

(admin freudian slip)

Boian Mitov

3:51 PM

 

19-rsn-007

3:51 PM

I have used arduino the old fashioned way, but I am sure gonna play around with this a little

Boian Mitov

3:51 PM

Controlling the 3 generators with Wii controller ;-)

Non-ICE

3:51 PM

seems to me more now than last time i tried it that its worth the 20 bucks

Boian Mitov

3:52 PM

In this case we control the frequency and the asymmetry of the generator with the joystick

Boian Mitov

3:53 PM

Display analog values on OLED display:

Boian Mitov

3:53 PM

 

Boian Mitov

3:54 PM

Displaying pressure humidity and temperature on the OLED

Boian Mitov

3:54 PM

 

Boian Mitov

3:55 PM

each one at different location on the screen

Boian Mitov

3:55 PM

Controlling the speed of a stepper with analog pin:

Boian Mitov

3:55 PM

 

pt

3:57 PM

hi @Boian Mitov just wanted to stop in and say hi and thanks for all the smart work on Visuino

Frank Buss

3:57 PM

where do you specify the update rate of the display?

Boian Mitov

3:57 PM

You don't It automatically updates

Boian Mitov

3:57 PM

but you can add clock generator to refresh it at specific time

Boian Mitov

3:57 PM

moment will show you in few seconds

Boian Mitov

3:58 PM

Controlling robot motors with joystick:

Boian Mitov

3:58 PM

 

Liam Kennedy

3:58 PM

For me I'd want to query a web api every "xx" seconds and display result

Liam Kennedy

3:58 PM

But that's "my thang"... hah.

Boian Mitov

3:59 PM

Controlling the robot with PS2 controller

Boian Mitov

3:59 PM

 

Frank Buss

3:59 PM

this looks like it can get very confusing for bigger projects, is it hierarchical, so can you define sub-blocks and sub-sub-blocks?

Boian Mitov

3:59 PM

Actually for querying server at specific times you can follow my instructables ;-)

Boian Mitov

3:59 PM

Discussions