golaat / Adafruit.Pwm

C# implementation of Adafruit PWM Servo Pi Hat driver
MIT License
11 stars 1 forks source link

Issue: system.void for generating new controller error #2

Closed SwampyPk closed 8 years ago

SwampyPk commented 8 years ago

Hello! I decided to pick up an old project and I've been trying to use your stuff again. However I get this one issue. 'System.Void' is not defined or imported? I've never seen this error before so I'm pretty stumped.

Any help would be much appreciated, I'm pretty sure I've imported all of the right stuff, also do I need I2C for this to work? (as an import).

Thanks, James

`using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; using Adafruit; using Adafruit.Pwm; // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace ServoActivation_Example { ///

/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
    }
    public void ServoExample()
    {
        const int servoMax = 480;
        var servo_X = new PwmController();
        servo_X.SetDesiredFrequency(60);
        servo_X.SetPulseParameters(0, servoMax, false);
    }
}

} `

tyeth commented 8 years ago

it's not that tick/apotrophe before the first line is it `using System;

SwampyPk commented 8 years ago

@tyeth I managed to fix it, I think it was a vb error as my reinstallation fixed my issues. The tick was a thing from github, not part of the code.