Again the Voltage input is a Basic Micro hardware or Software issue that Nathan probably need to resolve...
But it works on my Arc32 Phoenix:
I get the results:
VS1 (hex) is -> 14A
VL (hex) is -> 154
VS2 (hex) is -> 14A
VS1 voltage is: 6.44v
VL voltage is: 6.64v
VS2 voltage is: 6.44v
I am not saying that there is not issues here as my VL is a 9V, but again mine was one of the first boards and it probably has a 2 to 1 divider on VL...
Hint: the first time I ran this I got the results:
Moving servo: 0
VS1 (hex) is -> 6
VL (hex) is -> 152
VS2 (hex) is -> 8
VS1 voltage is: 0.11v
VL voltage is: 6.60v
VS2 voltage is: 0.15v
But that is when I remembered that I had not turned on the switch for servo power...
As for C code, there have been a few of us who have done it. I have built a version of the phoenix code in C. That is covered in a couple of different threads including: viewtopic.php?f=45&t=6677
The IDE does support C programming some. But is pretty primitive in it's support. No color coding, no project parameters, ... With my stuff I have been able to make libraries, but I had to do it outside of the IDE. That is Studio does download a complete version of the H8 GCC compiler and tools. I created a make file (used Microsoft's version of make) that allows me to create libraries. One version for BasicAtom Pro 28 (H8/3694) and one for BasicAtomPro40/Arc32 (H8/3687). To use the libraries I have to muck with the Linker files that Studio generates when you ask it to create a new C project.
Another user created another set of libraries for BAP28/BAP40 (Note: we have shared many of the ideas between the two code bases). You can read more about it in: viewtopic.php?f=4&t=6136
. I do not believe his version of the code base uses libraries, but you need to add all of the source files that you use to the project...
The differences between these sets of libraries, was that he has added a lot more support for higher level devices and sensors, where I have spent more of my time at lower levels to try to support the underlying hardware and to give you some of the same support in C as you get in basic. Things like: HSERVO (works pretty well on Arc32, still needs more testing and work on others...), HSerial ...
I hope that helps.