How to get mad? – or: using building blocks

madias
Wed Aug 03, 2016 11:09 am
Last week I decided to learn some basic android app development, especially to use Bluetooth and STM32.
So I had two possibilities:
The “hard” way: Android Studio. (I do not like java)
The “lazy” way: MIT app inventor 2
The app inventor 2 is preconfigured to use with BT and there are many arduino BT / android examples out there. So I decided to go the lazy way….BUT:
The “IDE” uses “building blocks” instead of programming code. So after a week i have given up. Even implimenting a simple array ended up in dozents of colorful puzzle blocks and a confused code layout.
Example:
Image
So in my view the whole project lost the overall potential, caused by this silly block-code model. Building blocks are good for teaching basic programming visually, but with semi-complex programs you lose the overview completely (especially if you do not own a 60′ monitor).

So: Lost one week and goto—> “the hard way”


Slammer
Wed Aug 03, 2016 11:29 am
The building blocks is an educational tool for kids….. not for development….
We have an overblown example of “easy programming”.

madias
Wed Aug 03, 2016 11:53 am
It’s a sad thing, because there is nothing against doing things easier. The whole concept of the app inventor is not too bad: Implementing sensors, connections, graphics, sprites, canvas, buttons, sliders, timers and even websites as drag&drop as first step and then programming it as a second step. So instead of those blocks it would be more effective using a simple language like the “Arduino C++” Personally I learned C++ because of using the Arduino IDE (years ago), but where is the “learing curve” using this blocks?

mrmonteith
Wed Aug 03, 2016 12:25 pm
I’m just as comfortable in C, C++, Java etc. But I was working on 4WD chassis and wanted to control it via an app on my phone. I didn’t want to spend huge amounts of time having to learn how to build phone apps just to control it. I stumbled onto App Inventor and someone had already put together and app to control a car via Bluetooth. So I had it up and running in a short amount of time. I was planning on going back and using the voice recognition part to control the car but too many other things came up. It helped in my case but mine was very simple. I’m sure adding decision making etc makes the simple blocks get out of hand. It’s always a balance of what you need to do the job and how much of a learning curve are you willing to take to get to where you need. If I was going to use a lot more phone apps for things then I would spend time learning a more robust phone app development tool.

Michael


mrburnette
Wed Aug 03, 2016 1:08 pm
I had a 6 month run with PSoC and their Windows-only Creator IDE a couple of years back. It is a “block” builder or sorts. However, the underlying code generated is exposed for all public objects, some priority objects only export API’s.

What I found interesting after 90 days of cursing the IDE is that there is a way to impose the programmer’s will on every object but it all must be done with assembler or C as C++ is not naively supported (but there is a work-around.)

So, a multidimensional array could be created in C or C++ and provided with an API which would then become a custom object that could be dragged-n-dropped into the larger logic design. The second 90 days of playing with the IDE was actually a joy but one does need to develop a good understanding of the basics and become extremely aware of property sheets and hooks. Not a weekend toe-in-the-water experiment.

Ray


zoomx
Wed Aug 03, 2016 1:48 pm
I played with AppInventor when it was a Google tool some years ago.
I believe that it is a tool like the old Visual Basic (not VB.NET): you put elements and code for them. It is a programming based on events. What happens if you push buttons, what happens if data arrive, what happens if some sensor get some values and so on.
My pourpose was to write a simple app to take photos and some data as a datalogger. I discovered that AppInventor was not capable to take pictures, it simply start the camera and then you have to shoot manually. AppInventor2 is not cabaple too to shoot a picture.
I don’t believe that this one is a tool for kids but is a tool for simple applications, you can fond some of them in the Google Store.

I remember that there is a Basic (a modern basic not the old one with line numbers) compiler but I don’t remember the name.


madias
Wed Aug 03, 2016 2:00 pm
On most every languages or “blocks” you’ll start begin missing “C++” if you need specific data types, like uint8_t, int16_t. (That’s my biggest complaint on the Arduino IDE with their stupid “byte” and “int” definitions because there is a BIG difference if you’re on 8- or 16/32bit MCU’s, so their “ints” are NONE specific (unsigned 16bit on AVR, unsigned 32bit on 32bit MCU’s) and this is one reason why many of old libraries won’t work on non AVR structure)
On a project I made before – analyzing MIDI Waldorf-Sysex strings, with a totally strange data(type) structure (signed 12bit (or24?, can’t remember) +chunks in byte packages) – it was done on STM32duino side within minutes, on Processing (java…) I got grey hairs.
On app “inventor” you won’t even thing about such things: You only have floats…
So I would need a C++ android dev tool :)

madias
Wed Aug 03, 2016 2:07 pm
zoomx wrote:
I remember that there is a Basic (a modern basic not the old one with line numbers) compiler but I don’t remember the name.

simonf
Wed Aug 03, 2016 6:57 pm
zoomx wrote:I remember that there is a Basic (a modern basic not the old one with line numbers) compiler but I don’t remember the name.

RogerClark
Wed Aug 03, 2016 9:39 pm
I have tried a few of these block based languages, mainly game creators, and I quickly came across the same sort of off problems that Matthias encountered.

Some things that could be done fairly easily and concisely in a non Block language, require crazy workarounds in Block languages ( ending up with huge amount of duplicated blocks.

I don’t think PSoC Creator is the same sort of tool at all. I thought with PSoC, basically used a graphical UI to a code generator, and that on the whole, the final step was either to modify the code by hand ( unless what you wanted to build didn’t really require and branching type functionality)

PSoC Creator is more like the STM Cube in steroids.

PS. I am likely to need to use my PSoC soon, as I need to accurately measure some millivolt outputs from a thermopile sensor, and the in built OpAmps in the PSoC make it an ideal device for this task


simonf
Wed Aug 03, 2016 11:47 pm
RogerClark wrote:
PSoC Creator is more like the STM Cube in steroids.


RogerClark
Thu Aug 04, 2016 12:39 am
What put me off the PSoC was that it was possible to brick the board if you forgot to upload the bootloader as part of the program

But they seem to have now fixed this as the snap off part contains a full programmer rather than simply a USB to serial converter

I managed to get a free new PSoC at Maker Faire but have not had time to play with it ;-(


simonf
Thu Aug 04, 2016 2:32 am
The Psoc is a perfect development device for small projects in theory as you can build a complete “Thing” on one chip all your shift regs counters flip latches etc programmed into one device just add your sensors and displays and your off. The problem is you can do so much with the thing, you can spend days just adding your I2C’s SPI’s UART’s before you even start the software development. I did not look at the samples much but a few basic templates such as uP with 1 I2c/SPI/UART and 2 8 bit parallel ports. Start with that template then knock off / add what you want. As I said I started with it but could see a week/month of my life getting sucked into it.
In a traditional STM development you pull out the data sheets find a processor that’s got all the peripherals you need. In PSOC you just add the peripherals you need.

PS I read some ware that people were using the snap off bit as a second PSOC kit but you need a separate programmer to utilize it. Also you can debug with the snap if bit as its not just a serial converter.


mrburnette
Thu Aug 04, 2016 2:49 am
RogerClark wrote:
<…>
I don’t think PSoC Creator is the same sort of tool at all. I thought with PSoC, basically used a graphical UI to a code generator, and that on the whole, the final step was either to modify the code by hand ( unless what you wanted to build didn’t really require and branching type functionality)
<…>

RogerClark
Thu Aug 04, 2016 3:57 am
Hi Ray

I vaguely remember software blocks in PSoC creator and I understand that the hardware and software connections (wiring) can be done in the graphical tool

I am really not diss’ing PSoC creator, I think its a great tool, but its not at all like App Inventor.

I thought in PSoC the coding is done in C by typing the syntax not by dragging coding elements e.g. To make the led blink you have to type the code or the for loop
e.g. in their video https://youtu.be/9NZe7yhPYuo?t=255

Where as with the graphical programming languages e.g. like in App Inventor, that Matthias was trying to use, the for loop looks like a U shape thing on its side, which you drag onto the screen (no minimal typing if at all)

https://youtu.be/I_GesyvKnbo?t=64


zoomx
Thu Aug 04, 2016 6:19 am
madias wrote:On most every languages or “blocks” you’ll start begin missing “C++” if you need specific data types, like uint8_t, int16_t. (That’s my biggest complaint on the Arduino IDE with their stupid “byte” and “int” definitions because there is a BIG difference if you’re on 8- or 16/32bit MCU’s, so their “ints” are NONE specific (unsigned 16bit on AVR, unsigned 32bit on 32bit MCU’s) and this is one reason why many of old libraries won’t work on non AVR structure)

Leave a Reply

Your email address will not be published. Required fields are marked *