
patrick_c#
Hello, i tried to program my EZ Robot with C# under Ubuntu 15.04.
using System;
using EZ_B;
public class HelloWorld
{
public static void Main()
{
Console.WriteLine("Enter IP of EZ-Robot");
string ip = Console.ReadLine();
Console.WriteLine("IP: "+ip );
Console.WriteLine("trying "+ ip);
Console.WriteLine("trying to connect with " +ip);
//connecting
EZB _ezb = new EZB();
_ezb.Connect(ip);
Console.WriteLine("connecting...");
if (_ezb.IsConnected)
{
Console.WriteLine("[+] EZB connected at ip: " + ip);
}
else
{
Console.WriteLine("[-] EZB NOT connected at ip: " + ip);
}
}
}
Thats my code, but if i execute it...
patrick@patrick-X781X-X782X:~/ezrobot$ mono bsp.exe
Unknown heap type: #GUlD
Unknown heap type: #Blop
Enter IP of EZ-Robot
192.168.1.1
IP: 192.168.1.1
trying 192.168.1.1
trying to connect with 192.168.1.1
Missing method .ctor in assembly /home/patrick/ezrobot/EZ_B.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /home/patrick/ezrobot/EZ_B.dll mtoken: 0x0a00000a
Unhandled Exception:
System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'EZ_B'.
at HelloWorld.Main () [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'EZ_B'.
at HelloWorld.Main () [0x00000] in :0
There must be a mistake with the "ez.Connect" command....
Thanks for help, Patrick.
Alan
This is to make a servo calibrate.
It does work in Windows.
But it don´t work...
Code:
Code:
Code:
Try this...
Code:
Set the fine tune before you use the servos - because that's an offset which the servos will require.
PS, thanks for wrapping your code
[u]bsp.cs(12,14): error CS1056: Unexpected character `'
bsp.cs(12,21): error CS1056: Unexpected character `'
bsp.cs(12,25): error CS1056: Unexpected character `'
bsp.cs(12,31): error CS1056: Unexpected character `'
bsp.cs(12,31): error CS1525: Unexpected symbol `Fine', expecting `,', `;', or `='
bsp.cs(12,36): error CS1056: Unexpected character `'
bsp.cs(12,42): error CS1056: Unexpected character `'
bsp.cs(12,49): error CS1056: Unexpected character `'
bsp.cs(12,55): error CS1056: Unexpected character `'
bsp.cs(12,60): error CS1056: Unexpected character `'
bsp.cs(12,70): error CS1056: Unexpected character `'
bsp.cs(12,70): error CS1525: Unexpected symbol `5', expecting `,', `;', or `='
Compilation failed: 12 error(s), 0 warnings
[/u]
When googling the error "error CS1056", it could be caused by a European character in code: https://msdn.microsoft.com/en-us/library/59k0x971.aspx
Mono, like most programming languages, it not friendly to all character sets. Given that it's complaining about the commas "," and semicolons ";" or something.
Notice how after filtering the code that you posted through notepad (Which removes any bits outside of the ascii-7 charset), displays different errors.
Somehow, your keyboard is putting strange characters into the code while you type.
Such as this: https://teamtreehouse.com/community/compiler-error-in-if-else-statement
I believe the issue is with the character-set on your pc.
i googled and found that somebody installed Mono 4.0 and it worked.
On the Mono homepage i found "Mono develop". A very useful program.
Could be "Visual Studio Lite" for Linux
But there are still the same errors. With the newest Mono version....
I´ll try something else tomorrow, by me it´s 11:48 PM
Good night, and thanks for your time
I am using Ubuntu 15.04. With german keyboard layout.
I am woundering about, that if i delete this line
Code:
it compiles without no warnings.
Code:
if i use this code, there are the errors i posted....
I have also no English keyboard... :/
But I found an old (very old) Panasonic Toughbook CF29 with Englisch keyboard. I´ll try later with an englisch installed Kali Linux.
Thanks for your time!
It might also be the selected character set in the operating system - not just the keyboard.
with EN settings, it compiles. So I have to set only the keyboard layout.Code:
Difficult to find the right keys
Thanks for your great time and help
Lol, I want to work at ezrobot