Working with Analog joysticks in IoAbstraction
IoAbstraction fully supports analog joysticks, and it does so in many modes, you can use them in three ways: You can get the values of the joystick using an AnalogDevice directly. This is the simplest case and you would read the present floating point value as needed. You can treat an axis of the joystick as a rotary encoder, and either use it to track a range of values, or in direction only mode.
Working with Analog input events in IoAbstraction
IoAbstraction has a class named AnalogInEvent to support event based programming for Analog Inputs, it is based on the BaseEvent class within the base library TaskManagerIO. The class itself is very flexible and can work with both polling and interrupt based approaches, or even a hybrid of the two. If you are not familiar with events, I recommend reading about them in the above TaskManagerIO link. You can see the reference guide for analog event here.
IoAbstraction Analog Core documentation
IoAbstraction has a simple interface to the analog capabilities of all supported boards. It provides frequently used functionality around acquiring and setting analog values from ADC, PWM and DACs. Having the ability to read and write analog values as float, where the value is between 0 and 1; where 0 is off and 1 is fully on. this capability allows you share code across different Arduino and mbed boards. The base class for this abstraction is AnalogDevice and you can see the full documentation in the reference guide.
Basic current sensing on Arduino
I’ve got a side project of building a digitally Arduino controlled PSU that also includes an accurate component tester. In order to do this I’ll have to be able to monitor the current flowing through a circuit, so I’d need some way of monitoring this. Before continuing, I’d like to say that is not an exemplar of how to build a great current sensing circuit, it’s a prototype shown for example purposes only.