Giter Club home page Giter Club logo

Comments (10)

nakkaya avatar nakkaya commented on July 17, 2024

I've merged your pull request.

No idea about the dotimes behaviour, I'll look into it.

from clodiuno.

Gonzih avatar Gonzih commented on July 17, 2024

Doesn't fix issue for me. :( As I can see :digital-in in conn is nil for me.

(ns clojure-arduino.core
  (:use :reload-all clodiuno.core)
  (:use :reload-all clodiuno.firmata))

(System/setProperty "gnu.io.rxtx.SerialPorts" "/dev/ttyACM0")

(defn -main []
  (let [board (arduino :firmata "/dev/ttyACM0")]
    (println @board)
    (Thread/sleep 5000)
    (pin-mode board 12 OUTPUT)
    (digital-write board 12 HIGH)
    (close board)))

{:version [2 3], :port #<RXTXPort /dev/ttyACM0>, :interface :firmata}
Exception in thread "main" java.lang.NullPointerException (NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:5440)
        at clojure.lang.Compiler.eval(Compiler.java:5415)
        at clojure.lang.Compiler.eval(Compiler.java:5391)
        at clojure.core$eval.invoke(core.clj:2382)
        at clojure.main$eval_opt.invoke(main.clj:235)
        at clojure.main$initialize.invoke(main.clj:254)
        at clojure.main$null_opt.invoke(main.clj:279)
        at clojure.main$main.doInvoke(main.clj:354)
        at clojure.lang.RestFn.invoke(RestFn.java:422)
        at clojure.lang.Var.invoke(Var.java:369)
        at clojure.lang.AFn.applyToHelper(AFn.java:165)
        at clojure.lang.Var.applyTo(Var.java:482)
        at clojure.main.main(main.java:37)
Caused by: java.lang.NullPointerException
        at clodiuno.firmata$eval54$fn__55.invoke(firmata.clj:95)
        at clojure.lang.MultiFn.invoke(MultiFn.java:171)
        at clojure_arduino.core$_main.invoke(core.clj:12)
        at clojure.lang.Var.invoke(Var.java:361)
        at user$eval112.invoke(NO_SOURCE_FILE:1)
        at clojure.lang.Compiler.eval(Compiler.java:5424)
        ... 12 more

from clodiuno.

nakkaya avatar nakkaya commented on July 17, 2024

Should be fixed now. I've manually populated digital in/out ports. Tested on Mega.

from clodiuno.

ardumont avatar ardumont commented on July 17, 2024

Hi,

ahhh, i think your problem is elsewhere. I did struggle with this the all week end.

What's your linux distribution ?

On Ubuntu the devices is not seen by the underlying api clodiuno uses RXTXcomm.jar - i opened a pull request to notify @samaaron about this on his api https://github.com/samaaron/serial-port (which does some of the stuff clodiuno does) - https://github.com/samaaron/serial-port/pull/4/files

You must link your device with a name that starts with /dev/ttySxx something else it is not seen.

For me, i did this:

ln -s /dev/ttyACM0 /dev/ttyS42

Hope this helps.

from clodiuno.

nakkaya avatar nakkaya commented on July 17, 2024

You can work around that by adding,

(System/setProperty "gnu.io.rxtx.SerialPorts" "/dev/ttyACM0")

I've tested it on an Ubuntu 12 with a Mega 2560 which also registers as /dev/ttyACM0.

from clodiuno.

ardumont avatar ardumont commented on July 17, 2024

Thanks, did not know that :D
I will try your fix now.

Thanks again

from clodiuno.

ardumont avatar ardumont commented on July 17, 2024

All is working for me - even the tips!

from clodiuno.

Gonzih avatar Gonzih commented on July 17, 2024

@nakkaya can you push changes to clojars?

Thanks

from clodiuno.

nakkaya avatar nakkaya commented on July 17, 2024

Pushed.

Best,

Nurullah Akkaya
http://nakkaya.com

On Mon, Jun 4, 2012 at 2:06 PM, Max Gonzih
[email protected]
wrote:

@nakkaya can you push changes to clojars?

Thanks


Reply to this email directly or view it on GitHub:
#1 (comment)

from clodiuno.

ardumont avatar ardumont commented on July 17, 2024

Thanks.

2012/6/4 Nurullah Akkaya <
[email protected]

Pushed.

Best,

Nurullah Akkaya
http://nakkaya.com

On Mon, Jun 4, 2012 at 2:06 PM, Max Gonzih
[email protected]
wrote:

@nakkaya can you push changes to clojars?

Thanks


Reply to this email directly or view it on GitHub:
#1 (comment)


Reply to this email directly or view it on GitHub:
#1 (comment)

from clodiuno.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.