ArduinoIO HAL component

More
30 Jan 2023 15:08 #263242 by billykid
Replied by billykid on topic ArduinoIO HAL component
Thanks Dino, it will be useful for me to read the dc spindle current and pass it to linuxcnc
thanks again
Mauro
The following user(s) said Thank You: dinodf

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

More
09 Apr 2023 06:36 #268646 by rhyno440
Replied by rhyno440 on topic ArduinoIO HAL component
Hi, i am having a problem getting Linuxcnc to load with ArduinoIO.
It says - execv (arduinoIO): Permission denied.
I attached the Bug report.
I tried adding permission to the .rules file but no luck.
any help would be greatly appreciated.
Thanks
Ryan

 

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

More
09 Apr 2023 06:39 #268647 by rhyno440
Replied by rhyno440 on topic ArduinoIO HAL component
sorry here is the attached report
Ryan
Attachments:

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

More
09 Apr 2023 11:20 #268661 by tommylight
Replied by tommylight on topic ArduinoIO HAL component
Search for arduino permission denied, look for " add uses to dialup group"
And also, just in case
sudo apt purge brltty
The following user(s) said Thank You: dinodf

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

More
09 Apr 2023 17:38 #268694 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
Hi,
to connect to Arduino you need to add the user to dialout group,
sudo usermod -a -G dialout rhyno
also have to set the execute flag to ArduinoIO
sudo chmod +x ArduinoIO

and need to have installed python-serial
sudo apt-get install python-serial
The following user(s) said Thank You: tommylight

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

More
09 Apr 2023 20:24 #268709 by rhyno440
Replied by rhyno440 on topic ArduinoIO HAL component
Adding me to the group dialout seems to have worked.
I also noticed I needed to switch from ttyACM0 to ttyUSB0 in arduinoIO since I am using an arduino UNO.
I really appreciate the help, this is going to help with my control panel.
Thanks again!
Ryan

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

More
12 Apr 2023 09:47 - 12 Apr 2023 09:48 #268880 by rhyno440
Replied by rhyno440 on topic ArduinoIO HAL component
Hi again guys, sorry for being a noob at this.
I have a question about the python section.
How do I adjust the number of pins?
I have a mega 2560 and would like to use as many digital inputs and outputs as possible.
adjustments to the arduino sketch don't seem to have an effect, and trying to adjust the number of inputs and outputs in the python script just causes it to no longer show in Halshow. Do i need to change both the sketch and the python? 
thanks in advance
Ryan
Last edit: 12 Apr 2023 09:48 by rhyno440.

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

More
14 Apr 2023 07:23 #269000 by rhyno440
Replied by rhyno440 on topic ArduinoIO HAL component
Thought I would post an update.
I did finally sort this out, I currently have 16 input and outputs.
I started in the Arduino IDE and properly ID pins  as input or output.
Then update the python script to reflect the number of each.

I do still have the occasional problem with the outputs.
i can have 7 outputs, 8 outputs or 16 outputs.
Trying to have 9, 10 or 18 outputs causes the hal component to not show in halshow.
At this point this will work, I needed 12 outputs for LEDs.

Pretty simple in hind sight, but I'm still pretty new to coding at this level.
Thanks again for the code, this makes my custom control panel a reality.
Ryan
 

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

More
20 Apr 2023 22:23 #269526 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
Hi,
to have 12 outputs you have to edit the arduinoIO.ino and set all pins in the array pinOut (the name of the pin you wanna use as output), also set the init state of all pis in pinInitState and if the pin need to be inverted to have the correct state in pinOutInvert; this 3 array must have the same number of the element, 12 in your case; 
Then you have to edit the file arduinoIO.py and set nOutput = 12

I have tried and there is a problem :-( i try to fix it

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

More
20 Apr 2023 22:41 - 20 Apr 2023 22:47 #269528 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
I have fixed the BUG, thank you for the report, I am sorry for the long time to answer but I have not received the notification of your message :-(

Try the new file: github.com/DinoMesina/arduinoIO/blob/main/arduinoIO.py
Last edit: 20 Apr 2023 22:47 by dinodf.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum