arduino mega 2560

More
23 Feb 2020 05:59 #158274 by tjtr33
arduino mega 2560 was created by tjtr33
I didnt see mention of ArcEye's hal module for arduino 2560.
So I thought Id publicize it now.
Its first mentioned here in the forum but not under hardware
see
forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc
It works!
I loaded it into an arduino uno ( thats all I had and it was just to satisfy the serial port open code )
and halcompil-ed it (--compile, had no problems, but manually copied /usr/lib/linuxcnc/modules as --install didnt play that)
then ran halcmd
loadusr serialreceiveTJP (my annotated version for testing)

and it IMMEDIATELY started reporting 32 bits of info to the terminal
( which was messy but the code warns to remove 3 lines before really using so doh!)
and
halcmd: show pins
showed 32 new useful pins!

also the code showed me a new (to me) pin naming trick
"""
pin out bit bit-##[32] = false "Output bits";
"""
this creates 32 outpit pins autonamed to whatevernameyoulike-NN where NN will become 00 thru 31
cool!
Thank You ArcEye!

just FYI there's some cheap non-realtime i/o for y'all

tomp

terminal session showed
...
tomp@dbn9sda1:~$ halrun
halcmd: loadusr serialreceiveTJP
halcmd: 00000000010100000100000001000000
00000000010100000100000000000101
00000000010100000100000000000101
sho00000000010100000100000000000101
w pin00000000010100000100000000000101

Component Pins:
Owner Type Dir Value Name
6 bit OUT FALSE serialreceiveTJP.bit-00
6 bit OUT FALSE serialreceiveTJP.bit-01
6 bit OUT FALSE serialreceiveTJP.bit-02
6 bit OUT FALSE serialreceiveTJP.bit-03
6 bit OUT FALSE serialreceiveTJP.bit-04
6 bit OUT FALSE serialreceiveTJP.bit-05
6 bit OUT FALSE serialreceiveTJP.bit-06
6 bit OUT FALSE serialreceiveTJP.bit-07
6 bit OUT FALSE serialreceiveTJP.bit-08
6 bit OUT TRUE serialreceiveTJP.bit-09
6 bit OUT FALSE serialreceiveTJP.bit-10
6 bit OUT TRUE serialreceiveTJP.bit-11
6 bit OUT FALSE serialreceiveTJP.bit-12
6 bit OUT FALSE serialreceiveTJP.bit-13
6 bit OUT FALSE serialreceiveTJP.bit-14
6 bit OUT FALSE serialreceiveTJP.bit-15
6 bit OUT FALSE serialreceiveTJP.bit-16
6 bit OUT TRUE serialreceiveTJP.bit-17
6 bit OUT FALSE serialreceiveTJP.bit-18
6 bit OUT FALSE serialreceiveTJP.bit-19
6 bit OUT FALSE serialreceiveTJP.bit-20
6 bit OUT FALSE serialreceiveTJP.bit-21
6 bit OUT FALSE serialreceiveTJP.bit-22
6 bit OUT FALSE serialreceiveTJP.bit-23
6 bit OUT FALSE serialreceiveTJP.bit-24
6 bit OUT FALSE serialreceiveTJP.bit-25
6 bit OUT FALSE serialreceiveTJP.bit-26
6 bit OUT FALSE serialreceiveTJP.bit-27
6 bit OUT FALSE serialreceiveTJP.bit-28
6 bit OUT TRUE serialreceiveTJP.bit-29
6 bit OUT FALSE serialreceiveTJP.bit-30
6 bit OUT TRUE serialreceiveTJP.bit-31

halcmd: 00000000010100000100000000000101
^C
The following user(s) said Thank You: phillc54, tommylight

Please Log in or Create an account to join the conversation.

More
24 Feb 2020 15:47 #158386 by bbsr_5a
Replied by bbsr_5a on topic arduino mega 2560
isent the code designed to run on a ESP 8266 or even as of realtime on a ESp32

Please Log in or Create an account to join the conversation.

More
26 Feb 2020 08:19 #158513 by tjtr33
Replied by tjtr33 on topic arduino mega 2560
Hello
I cant guess "isent"
is I sent
or isn't

If I sent
then where is the code

is isn't
then no, the code was wriiten for arduino mega 2560
please read
forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc

HTH tomp

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.079 seconds
Powered by Kunena Forum