0
\$\begingroup\$

Should I be asking this on Hardware Recommendations? That is – do I need some sort of test device? Or, hopefully, I can just my laptop …

I am developing a vending machine controller, as a hobby project.

I want to brush up my Ada skills and will use an Onion Omega2. Some details of the GPIO can be found at https://docs.onion.io/omega2-docs/using-gpios.html

My Ada is rusty, I am new to the processor and I won’t have the hardware for a while yet – what could possibly go wrong? :-)

Eventually, I will be using he GPIO to read from a numerical keyboard and to drive motors.

Questions: what’s the simplest, cheapest easiest way to test my code, to make sure that I read/write GPIO? I am fine with software, which is my day job, but lousy with hardware, so please don’t ask me to do any soldering.

Right now I want to make some very quick checks as to whether I can interact with GPIO, UART & WiFI from Ada, or whether just to fall back on C, for which more example code is available.

\$\endgroup\$
  • \$\begingroup\$ A good start would be to find a suiting development board, or look at this here: Using GPIO in PC to be able to control your GPIOs. There are options like the raspberry pie, where you can get the source code from the web. \$\endgroup\$ – Eggi Jan 14 '19 at 11:43
  • \$\begingroup\$ Sorry, but I am committed to the Omega2. When I Google, I can see how to test GPIO access on the Pi, but not on the Omega 2 \$\endgroup\$ – Mawg says reinstate Monica Jan 14 '19 at 12:46
  • 1
    \$\begingroup\$ The question was, what's the simplest way to test your code in software? Buy a USB GPIO Adapter or get a breakout board, which has buttons and leds which are connected to the PIOs of the omega 2, or to get a bit into hardware design and connect a led and a resistor to a GPIO and connect another GPIO with the right supply (logical 1). I've seen some nice boards on their homepage. \$\endgroup\$ – Eggi Jan 14 '19 at 13:02
  • \$\begingroup\$ Upvote, but, pardon me for being stupid - on whose home page? It looks like I ought to be able to adapt [this ]9https://thepihut.com/blogs/raspberry-pi-tutorials/27968772-turning-on-an-led-with-your-raspberry-pis-gpio-pins) which gets the Pi to light a LED - and then just hope that if I can read then writing is very similar \$\endgroup\$ – Mawg says reinstate Monica Jan 14 '19 at 13:16
  • 1
    \$\begingroup\$ The onion homepage. With this you have a breakout for your GPIOs. I would recommend reading about designing a Led (google knows a lot). Your GPIOs operate with about 3.3V, be aware of that. With this board you can connect the 3.3V pin to a GPIO and try to read it. If you read a logical HIGH from the pin you are good to go. But learning about electronics is the recommeded way here. The vending machine controller has to be connected too... \$\endgroup\$ – Eggi Jan 14 '19 at 13:22
1
\$\begingroup\$

It doesn't appear that Onion release a full simulator for the Omega2, so there's no way you can "test" your GPIO code. Of course, you can get an idea of setting up and getting it to compile Ada code, but it won't be a real test. Even then, without hardware, a simulator protects you from the real world (no capacitance, no bad connections etc). Get started on getting the less well supported Ada toolchain up and running and expedite your hardware shipping!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.