Arduino IO Expansion

More
2 years 8 months ago #294698 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
@billykid
How are you using it? Maybe the arduino-connector is not loaded before hal tries to use the Pins?
The following user(s) said Thank You: billykid

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

More
2 years 8 months ago #294718 by blazini36
Replied by blazini36 on topic Arduino IO Expansion
@Alex, you had responded to the github request I made of the same.
The following user(s) said Thank You: AlexMagToast

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

More
2 years 8 months ago #294735 by billykid
Replied by billykid on topic Arduino IO Expansion
Now it works, I changed the position of the "loadusr arduino" line and it starts normally. it doesn't measure yet but I will have to change some settings... now pin a0 measures 511 which corresponds to 2.5 volts of the ACS712 sensor at zero current. However, if the current varies and the pin drops to 2 volts, the measurement on HAL does not move, it seems to only read the first time.

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

More
2 years 8 months ago #294740 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
hmm, thats odd.

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

More
2 years 7 months ago #294990 by blazini36
Replied by blazini36 on topic Arduino IO Expansion
I posted an issue in the git explaining most of the problems I'm having with this. Might be better to do it here. I'll attach some examples that do work since it may help.
 
There is some weird issue with loading the python component. I  made a separate hal file to load arduino-connector and make the connections. I kept getting "pin xxx does not exist" regardless of where "loadusr arduino-connector" was in the file until I set "[HAL] TWOPASS = ON" in the ini file.

I had some issues with encoders, first they were just counting non-stop but I realized this is just because of the joystick conflict, the joysticks have to be disabled in the firmware as well. I have 4 encoders. 3 are attached to both interrupt pins, 1 is no interrupt. 2 of the interrupt encoders work fine. The other 2 do not. I'm not sure why the 3rd interrupt encoder does not work as it doesn't work with a simple sketch using the QuadEncoder  library either. I found another sketch that uses no interrupt library and the 3rd and 4th encoder work fine with this. I guess the point is, arduino-connector does not seem to work with non-interrupt encoders for some reason.

This one works with the interrupts
 

File Attachment:

File Name: EncoderTes...rupt.txt
File Size:1.21 KB


This one works with the non-interrupt encoders
 

File Attachment:

File Name: EncoderTes...rupt.txt
File Size:3.62 KB


I can't get the key matrix or LED mux working at all really. The key matrix kinda works but the key pins are very unreliable. The matrix hal pins "stick" or don't register, or just register very flaky. I've tried setting the LED muxed hal pins and they just don't seem to work right at all.

I've tested the key matrix with this sketch, it works perfectly printing to the serial terminal:
 

File Attachment:

File Name: MatrixKeyp...Test.txt
File Size:1.66 KB


I've tested the LED matrix with this sketch, works perfectly:
 

File Attachment:

File Name: LEDMatrix_Test.txt
File Size:1.37 KB


I've posted this before, this is the matrix circuit and Arduino connection
 
 

The Normal IO that I tested so far seems to work OK but I didn't spend a whole lot of time with it as I was working on figuring out if these issues were my problem or Arduino-connector.

Here is the firmware and python component I tried last, could be some issues here I'm not really one for code:
 

File Attachment:

File Name: LinuxCNC_A...ctor.txt
File Size:32.52 KB

 

File Attachment:

File Name: arduino-connector.py
File Size:17.68 KB





 

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

More
2 years 7 months ago #295001 by tommylight
Replied by tommylight on topic Arduino IO Expansion
Is the encoder issue on Arduino Nano?
Nano has only 2 interrupt pins, Mega has 6, no idea how many the ESP8266 or ESP32 have.

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

Time to create page: 0.314 seconds
Powered by Kunena Forum