News:

we are back up and running again!

Main Menu

Programming VB, C++

Started by veggie, November 29, 2016, 03:13:57 PM

Previous topic - Next topic

veggie

rambling about languages,

In response to Jens and AdeV (and myself) yapping about languages in a previous thread, I think it's interesting how we get attached to the languages that we first learn and have success with.
Since I started programming in QBasic back in the 90's I have been hooked on BASIC's of all kinds.
Many new languages have come along like C#, J#, JAVA, PERL etc... but I love Visual Basic. :D
I like the procedural based languages and still do some projects in VB6 because of the "lightweight" and fast deployment capabilities of it.
Yes, I am a bit of a relic using VB6, but there is still a core bunch of us who still love it. In the industry that I work there are still hundreds of VB6 applications still in use which have not been migrated to more modern languages. Very reliable.
When needed I jump to VB.NET and I mostly still use it in a procedural sense with very little Object Oriented Programming (OOP).
I find that if one does not need any instantiation to duplicate classes in an application then procedural code is fine and VB.NET can do that too.

The C++ variant used by the Arduino is also a great language to use. Simple and precise, it allows easy access to the control of relays and MOSFETs and also allows for the easy reading of analog sensors of all kinds.

Jens, what Language and Program development software are you using in LINUX to write programs on the PI ?

Veggie


AdeV

I think I managed to start before you Veggie :) First contact with a computer was back in about 1981, when I got to play with a BBC Model "B"... although I didn't touch another computer then until 1984 when, in late summer, we took delivery of an early Sinclair QL. After that, there was no stopping me... Along the way I also dabbled with Sinclair ZX Spectrums, BBC Masters (like the "B" only with more oomph), with a Sharp MZ-80K thrown in for good measure. Later I got to play with a Commdore PET and a Tandy TRS102. All these were "work" machines for me, and since they all had BASIC on them in one form or another, that was the language I ended up specialising in.

Fast forward through college (we picked up a bit of C, C++, Eiffel, Ada, SQL, MC68000 assembly, and probably some others I've forgotten in the meantime), and into the world of work where I did a bit of MS Access (VBScript) before getting stuck into VB3, then VB4, 5 and 6, then switching to VB.Net which I still use to the current day. Most of those early BASICs are now in the dustier parts of my memory, but I still have a few old computers knocking around - including several Sharp MZ80Ks and 'Bs...

One day, I will write a CHP monitoring app for the Sharp MZ80K, just because I love the look and feel of the machine. Even though the keyboard is appalling, and the graphics are limited to a 40x20 character grid... the whole "retro" thing appeals to me: 1950s Lister engine, monitored by Arduinos, operated by a 1980s micro, providing power from a modern Chinese alternator. A right old mixture :)

Must admit, when I made the jump from procedural to OO, it was a complete jump... pretty much everything I do now is OO based, I just find it to be a more natural way to think of programs. The real world has "objects" with "properties" and "methods" (commands or things to make them do stuff). Of course, then you get into polymorphism, multiple inheritance and a whole bunch of other esoteric weirdness that the real world simply doesn't obey... but that's another story.

I write software for the Pi occasionally, now that the Mono framework is so good, I just use VB.Net - the same program that runs on a PC generally runs just fine on the Pi. Even the UI works, which always used to be the major sticking point. I can also muddle by in Javascript, C# (so long as I'm just modifying someone else's code & not having to write from scratch), and I can usually work out what a Pascal program is doing, even if I can't actually write anything in it.
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

veggie

AdeV,

Are you telling me there's a VB or VB.NET emulator for LINUX ?
Please tell me more. !!!
I would love to be able to program and run VB.NET programs on an laptop running LINUX.

I was hoping to use an older laptop as the "brain" for a control system. But of course Windows XP does not run VB.NET.
I dumped the Windows XP and loaded UBUNTU Linux and it brought the machine back to life. Fast and crisp.!!
The big problem was that I could not write VB programs for it.
But...you say there is a way ??

Veggie


AdeV

#3
Hi Veggie,

There sure is :)

I believe (could be wrong) there are now 2 ways of doing it. There's certainly one, and it works well. What you need to do is download the Mono framework (IIRC on Ubuntu; sudo apt-get install mono-complete mono-vbnc). Once installed, simply copy across whatever's in your /bin/debug or bin/release folder after building your VB.Net project, and run it using the mono commandline: mono <your_project_exe>. I believe frameworks 2 & 4 are very well supported (possibly 4.5? Can't remember). You can even run projects which are compiled as windows services, using the mono-service starter.

The second method, which I'm not certain supports VB, is Microsoft have released a preview of .Net Core, which is specifically designed for lightweight (compared to the full framework) development. There are versions for Windows, Linux and Apple Macs, so virtually no-one gets left behind :)

Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

mobile_bob

i spent some time back in the 90's learning C++ and found that to be interesting, never using it on anything
then about 10 years ago now, a friend started me toward pbasic and the parallax bs2 stamp

i can't imagine needing anything else!  :)

very simple, very intuitive and fast to get something that just works
as for more complex functions?  well i am not planning a mars project or going to the moon, or leaving the ground for that matter.

hell i can figure out how to automate just about everything related to cogen/trigen and its implimentation to a home, along with adding solar, wind, and any number of other variants and the needed stuff related using stamp micro's and those cheap relay board kits offered from china.

i can piggyback several stamps on a very basic buss system, and also have the ability for others and other languages to interface and communicate with the system...

and i know i am not even close to the sharpest tool in the shed!

it might be different for me had it not that i had to automate things mechanically for the better part of 25 years before i got my hands on a microcontroller.

bob g

veggie

MobileBob,

Ok....fast forward another 10 years from the Paralax and you have ARDUINO !!!!
You will be hooked!! There's a hundred types of cheap sensors, relays, MOSFETs, and meters available specifically for this board.
Once you get started on this stuff your wife will never see you again.
Heck...if you tell her that she may even run out and buy you one.  ;D

Super inexpensive, very simple to learn, easy to program, and thousands of code examples on the web.
There are youtube video of guys who have built ECM engine controllers, tachometers, shudown controllers, etc..etc

It's quite a large community.

Veggie

Jens

Quote from: veggie on November 29, 2016, 03:13:57 PM

Jens, what Language and Program development software are you using in LINUX to write programs on the PI ?


Sorry about the delay in responding, I only check in here when I happen to think about it ...

So far I am not using much of anything. I use a linux distribution called OpenPlotter on the pi which is very much boat oriented (which is my current vice) but allows for all kinds of nifty controls based on sensor input, all done via graphical interface.
I am also playing with Python but do not use any program development software as such at this time.
I am in a very steep section of the learning curve on Python's object oriented stuff as I have never done OOP before. My Thumper project was set up with a STAMP system for temperature measurements so this is a big step up for me. I have done programming in a number of languages but nothing object oriented until now.

BruceM

You can program the Arduino (Atmel) processors in about any language you like if you are willing to shell out  for a compiler.

As for the cheap arduino hardware, yes, but hobby quality, limited, and you can only stack so many of those boards together since there is no bus.  As for power controls, you are limited to a modest number of low side mofets or relays.  Your interface hardware quickly turns in to a big messy frig.  But still, it is so cheap you'd be foolish not to use the platform for any bobby prototyping or learning type projects. 



AdeV

Quote from: BruceM on December 11, 2016, 05:25:44 PM
...you can only stack so many of those boards together since there is no bus.

Well.... you can implement I2C on pretty much any Arduino very easily (just include the Wire library, and assign a couple of pins), that allows you to stack over 100 boards with relative ease.....  ;D
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

mobile_bob

most of you programmer types are light years ahead of me!

my time is so short in supply it is unlikely that i will be learning any new platform and its requisite language any time soon.

in the past i found that a bs2 stamp coupled to one of those relay board kits from ebay allows me the ability to control
the world (or at least my world)

no i don't have a really cool GUI screen or any of that, what i do have is the ability to write simple code
and using relay logic and a simple logic bus system i can stack as much stuff as i can imagine ever needing.

however all those cool arduino boards are cool, and yes it would be nice to have all the bells and whistles, but really...
having done without anything other than mechanical logic control (simple relays, pressure switches, temp switches etc)
for what seems like forever... the lowly bs2 is akin to NASA stuff to me now.

and it just works.

a few years ago, i looked into cubloc products, they had an interface board that would accept a bs2 stamp, as they also had a micro that was pin for pin compatible and it used some sort of basic language similar to pbasic from parallax. their products could also be programmed in ladder logic and i think even a mix of the two if needed.  they had some really cool interface stuff such as temp sensors, timers and all sorts of other stuff that makes life easier... and their stuff was more industrial rated or rather ready for real usage in control environments.

i guess it is each to his own and really what one needs to control, and to what level of control and what kind of interface one thinks he either needs or can live with or without.

fwiw
bob g