Examples

Hi,
I like to reset all my devices and here is the routine:
void resetDevices()
{
sys.disable5V(); // turn off switching transistor at the hSensor 5V supply line
sys.delay(200); // wait for discharging capacitors
sys.enable5V(); // turn on switching transistor again
sys.delay(50); // wait for stable reading from sensors
}

I have copied it from EXAMPLES/power-supply panel
Is it still valid the above?
Regards,
Fred

Hi Fred,

it should be working now but you need to change the hFramework version in WebIDE to “Development”:
devel
or if you work with VSCode, you need to build the newest version of hFramework from Github, following this tutorial:

By the way: 200ms can be too much or too less for capacitors to discharge, depending on the current consumption on 5V line. You may have to adjust this value.

Regards,
Radek

Hi Radek,

Thanks, your suggestion works, however this change to “Development” triggers other errors in my program.
hMot4.setActiveBreaking();
hMot1.setActiveBreaking();

I got the error:
MotorControl.cpp:40:8: error: ‘class hFramework::hMotor’ has no member named ‘setActiveBreaking’

So I prefer then to go back to ‘stable’ without the resetDevices() routine I have made.

Fred

Hi,
For the time being while inFramework version in WebIDE to “Development" mode,
use:

hMot4.setActiveBreaking();
hMot1.setActiveBreaking();

until it gets corrected.
Regards,
Fred

correction previous lines:

hMot4.setActiveBraking();
hMot1.setActiveBraking();

Fred

Hi Fred,

We’ve made some changes in hFramework library. One of them was replacing:

hMot4.setActiveBreaking();
hMot1.setActiveBreaking();

with:

hMot4.setActiveBraking();
hMot1.setActiveBraking();

because it contained a spelling mistake. Development version on our IDE is the newest one and contains all the changes. We will unify stable and development versions as soon as possible. For now you have to use Development and hMot4.setActiveBraking();, hMot1.setActiveBraking(); syntax. Sorry for inconvenience.

Regards,
Hubert

Hi Hubert,
Understood.
Thanks
Regards,
Fred