-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help documentation #11
Comments
Looks like you need a CHM reader. Could this help you out? http://chmreader.windows10appstore.net/win10apps.html Can you connect to the board and send/receive data? Can you share your Arduino sketch? Thanks for the compliment! |
Hello SolidSoils, The arduino sketch i'm using is the StandardFirmata that come with the Firmata examples in version 2.4.4. DigitalSetPort of your client library is working well, my troubles are only with i2c, when i send data with WriteI2C nothing happens. But i think is a problem of c# code by my side, so I will try again with other combinations. If this can help you to investigate what's wrong, when i upload the sketch below, everything goes as expected, and the coil is blinking on and off every 1500 seconds.
In any case, thanks for the time u dedicate to my issue, if u got any suggestion is really appreciated!! :) |
On your Arduino board you need a sketch implementing the Firmata protocol, including I2C. StandardFirmata is a sketch fully supporting this protocol. You can find it here: |
Dear SolidSoils, StandardFirmata is just the sketch i'm already using. |
The sketch you shared only seems to include the Wire library, though. Am I missing something? |
Maybe i wasn't so clear with my post. When i used the sketch below:
Things works well, and my relay blink. I used this sketch only to check that everything goes ok. Usually I use the StandardFirmata sketch uploaded into arduino, in combination of your library with this code in the client:
so, with the pressing of a button (button1) in my UI, i try to replicate what my example sketch does, but nothing happens. I've tried with session.WriteI2C(0x20, 0); with byte[] from 0 to 255. |
Thank you for your explanation. I am not too familiar with the Wire library, hence the misunderstanding. The SolidSoils4Arduino library implements the Firmata protocol as described here: http://firmata.org/wiki/Protocol Method As for the following line of code:
I cannot tell if address 0x20 you are using is correct, but in your event handler only a 0 value is written to it. Assuming this switches a relay off, do you have code in place switching it on? |
Hello again SolidSoils, i can't understand if is your code not working or what is going on in my code... Anyway now the line of code session.WriteI2C(0x20, 0); work, but with a little trick before... i try to explain what i've done: Using your code "as is" i can't figure out on how to write i2c commands, so i search a little in the StandardFirmata sketch code, where i found a global boolean variable named "isI2CEnabled" that is for setup setted as false. The way to enable I2C in the sketch seems to call a funcion named "enableI2CPins()", that is it self called inside the SYSEX-BASED commands section (method sysexCallback), switching in the command "I2C_CONFIG". Doing the trick with the code below the job work well, without putting hands on your code:
The only thing that is making me crazy is that the function "GetI2CReply" (that you can see as commented in the code above) is calling the REQUEST and not the REPLY SYSEX-BASED command, and happens that the code crash when messages are appended returning "Wait condition for I2CReply message timed out." and from now on any of the WriteI2C methods again called do not work anymore, i must restart (by powering off) the arduino. I'm trying now to figure out on what's wrong... I will let you know :) Please let me know if i'm doing something wrong... If there is a better way i haven't seen. Thank you!! |
Sorry,
i've not mentioned that for switching the relay on and off, i'm currently using a TextBox where i put "0" (switch the relay on) or "1" (switch the relay off) and pressing the button. The i2c expander work with a reverse logic, 0 = on, 1 = off. dunno why :) |
The session.GetI2CReplyAsync() doesn't work anyway |
Method I2C reply messages are only sent by the Arduino board. With method The board is then expected to return a continuous stream of I2C_REPLY messages at an interval which can be set using the The board can be stopped sending I2C_REPLY messages by calling the |
Thanks for your help. I don't know whats wrong, but the GetI2cReply still not work, when ReadI2CContinuous work as expected! Thanks again. |
You're welcom, glad I could help! |
Hi,
in windows 10 i'm not able to view the chm file, i can see the tree of the documentation but when i click a section nothing happen.
I was trying to find out a solution to get working the I2C communication, when i try to send data nothing happens! I dunno why but without a documentation i can't find out a solution.
this is my code:
i've tryed to put up ALL possibile combinations, but nothing happens (i've wired a PCF8574 with a common double relay board, so in any case i must heard the coil switching)...
Can i have a documentation working or i am doing something wrong opening it?
Thank you in advice for your reply, and compliments for the great work!
Fin3
The text was updated successfully, but these errors were encountered: