Last active 3 years ago

  1. 3 years ago
    Sat 18 Jun 2016 01:37:17 AM CEST
    gita07 started the conversation LED Control in swift with arduino and XCODE.

    can someone help me with this code???
    i'm traying to write this in code in swift. im programming a code for a control a LED - Light via Ethernet with Xcode OS X and arduino!

    if someone have a tip, let me know!
    the code is the following one:
    import Cocoa

    class ViewController: NSViewController {

    override func viewDidLoad() {

    // Do any additional setup after loading the view.

    override var representedObject: AnyObject? {
    didSet {
    // Update the view, if already loaded.

    @IBAction func ButtonON(sender: AnyObject) {

    // turn the LED on
    NSURL *url = [NSURL URLWithString:@"$1"];
    NSURLRequest *req = [NSURLRequest requestWithURL:url];
    [myWebView loadRequest:req];

    @IBAction func ButtonOFF(sender: AnyObject) {

    // turn the LED off
    NSURL *url = [NSURL URLWithString:@"$2"];
    NSURLRequest *req = [NSURLRequest requestWithURL:url];
    [myWebView loadRequest:req];


  2. Sat 18 Jun 2016 01:31:23 AM CEST
    gita07 joined the forum.