Author Topic: Simple tutorial on analog inputs with Arduino  (Read 38336 times)

0 Members and 1 Guest are viewing this topic.

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #10 on: April 13, 2015, 11:21:29 PM »
That's really great. I am out of country these days, so couldn't reply to your posts in time. Looks like you have figured it out yourself.

Or did you want these 8 switches on a single pot. This is possible too. Just use the map() and switch case functions in Arduino. See the command reference and examples on Arduino website.

Zafar

Offline linuxfan

  • Holding
  • Posts: 1
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #11 on: November 30, 2015, 12:05:37 PM »
Thank you for this really great piece of arduino code! Reading arduino pins, and sending data to mach3 is awsome feature. Can you please point me on how to send data from mach3 to arduino?
I would like to send for example X position DRO value to arduino, and then print out data on display. Can I just define variable as double, and ecquire its value like this in loop:

my_variable=regs[10];

And then in mach3 brains select data input as X DRO, and then terminate as modbus address 10, and select it as Output?
Or does this code work only one way, from arduino to mach3, and some major code correction has to be done to work other way?

Thank you,
Simon

Offline khalid

  • Active Member
  • Posts: 213
    • View Profile
    • My Wood carving
Re: Simple tutorial on analog inputs with Arduino
« Reply #12 on: November 25, 2016, 08:51:34 AM »
Zafar Bhai..u still out there?

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #13 on: November 30, 2016, 06:49:07 PM »
Zafar Bhai..u still out there?

Yes right here in Malaysia. Will be back this Sunday.

Offline nokialkatel

  • Active Member
  • Posts: 11
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #14 on: January 14, 2017, 06:11:52 PM »
hi! I need help from you zafarsalam

How to setup dro info on lcd connected to arduino modbus slave on arduino with shillings code modbus slave???

Ihave included wire.h and liquidcristali2c.h for lcd in arduino code.
From now I ned help for how to send data from mach3 -->>>brain-->>serial modbus plugin--->>>arduino modbus slave ?????
many users have this done but no documentation on arduino code, no info about serial plugin configs,

Help  and thanks

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #15 on: January 14, 2017, 09:07:43 PM »
hi! I need help from you zafarsalam

How to setup dro info on lcd connected to arduino modbus slave on arduino with shillings code modbus slave???

Ihave included wire.h and liquidcristali2c.h for lcd in arduino code.
From now I ned help for how to send data from mach3 -->>>brain-->>serial modbus plugin--->>>arduino modbus slave ?????
many users have this done but no documentation on arduino code, no info about serial plugin configs,

Help  and thanks

I am out of country right now. Will give you some tips on it when back home by this weekend.

Zafar

Offline nokialkatel

  • Active Member
  • Posts: 11
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #16 on: January 19, 2017, 04:24:18 PM »
Are you home Zafarsallam?

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #17 on: January 27, 2017, 04:03:55 AM »
Yes. I am here. I haven't tried shillings code on modbus. I am using Vinny's code. You can download it from the link on this thread. I have used it to display Mach DROs on LCD screen with arduino. I'll fish out the code, tidy it up and share it here in a few days.

Zafar

Offline nokialkatel

  • Active Member
  • Posts: 11
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #18 on: January 27, 2017, 04:45:59 AM »
Ok.thanks! I am waiting.
Can not find villy's code.

Offline zafarsalam

  • Active Member
  • Posts: 324
    • View Profile
Re: Simple tutorial on analog inputs with Arduino
« Reply #19 on: February 03, 2017, 10:24:20 PM »
Ok.thanks! I am waiting.
Can not find villy's code.

Download the pdf file in the first post on this thread. The links are in there.