There are are 2 ways to get help here and I am not sure which one you are asking for:
Mostly this site it to help people learn, so you use the example on this site, in the Arduino IDE and elsewhere to learn the basics, then ask here when you get stuck. By stuck, I mean you've obviously learnt something from the examples and tutorials but there's some part you are struggling with.
Or, if you want someone else to write the code for you, there are people who will do that for you; click on 'report to moderator' and ask for this to be moved to 'gigs and collaborations', the folk there take paid commissions. You will need to give some idea of how much you are willing to pay.
I managed to use the IR distance sensor using codes and libraries people here shared and helped others, I was sure it would be simple sending data via I2C to the address of the driver board and thought it would be similar to a project someone else has done here sending data to a motor for example...
oribenanson12:
I managed to use the IR distance sensor using codes and libraries people here shared and helped others, I was sure it would be simple sending data via I2C to the address of the driver board and thought it would be similar to a project someone else has done here sending data to a motor for example...
I think you are thinking the following:
There are libraries, lots and lots of them, that make doing certain things really easy without the need to know what's really going on underneath. If you think this you are correct.
There are projects that other people have done and shared their code for anyone to use. If you think this then you are also correct.
If you want to build a copy of someone else's project using their ideas and code, and they have shared that for anyone to use then you can build it.
However, if you come up with your own project, you own idea, which I think you have done in this case (am I correct?) then you cannot expect that there is code out there that will make your project work. For that to be the case someone else would have had to have the same idea as you and built it the same way you want to build it and be willing to share their code. I think this is what you are hoping for. This is highly unlikely.
You can use the libraries. You can use code others have decided to share, but if you want to build your own idea into a project the only 2 ways you will get the code is to write it yourself or get someone else to write it for you. If you want someone else to do it then either they are a good friend and will do it for beer, or they are not a friend and will want to charge a fee.
I want somthing similar that was shared and I will change it to fit to my project I sure there is a project someone has done that is 90% what I need and just do a few changes for the adress and data that needs to be sent...
Then maybe it comes with sample code, ask the supplier. Otherwise you are asking that someone else that used it is reading this and has code they are willing to share. Unlikely if you ask me.
oribenanson12:
Id like to have some guidance if someone can help me how to approach my project instead of just telling me how stupid I am...
I think we are telling you...
Reply #1 from me told you. Those are pretty much your options, if you follow what I said you get the guidance you are asking for. No one is telling you you are stupid, but if you don't want to do what has been suggested then you are in the wrong place for help.
oribenanson12:
I want somthing similar that was shared and I will change it to fit to my project I sure there is a project someone has done that is 90% what I need and just do a few changes for the adress and data that needs to be sent...
To know how to do the 10% you either need documentation for the chip or an example that uses the same (or compatible) chip. It might be that the Maxim MAX1415 driver is a compatible replacement for the MAX14574.
The interface for the MAX1415 is fairly easy. The first byte you send is a register address and the subsequent bytes go into that and subsequent registers. There are only two registers:
Register 0 is 'Sleep Mode' (0x00=Sleep, 0x01=Normal)
Register 1 is 'Voltage': 0 means 0V. Values from 1 to 255 mean voltages from 10 to 49.5
johnwasser:
To know how to do the 10% you either need documentation for the chip or an example that uses the same (or compatible) chip. It might be that the Maxim MAX1415 driver is a compatible replacement for the MAX14574.
The interface for the MAX1415 is fairly easy. The first byte you send is a register address and the subsequent bytes go into that and subsequent registers. There are only two registers:
Register 0 is 'Sleep Mode' (0x00=Sleep, 0x01=Normal)
Register 1 is 'Voltage': 0 means 0V. Values from 1 to 255 mean voltages from 10 to 49.5
I think it is a replacement of the14574
And by reading its datasheet you are absolutly right.
I will play with the voltages I just dont know how to talk to the registors and send the data I would like it to have a few if's
I'd change the distances and voltages.
I was thinking of somthing like:
If
Analog input A0=10cm
Then
Registor1= 5v
If
Analog input A0=15cm
Then
Registor1= 10v
I'll continue the loops and if's
Thanks for trying to help man!
BTW
If my project works id love to share it here with videos and info, weather or not I get help from the forum...
oribenanson12:
I think it is a replacement of the14574
And by reading its datasheet you are absolutly right.
I will play with the voltages I just dont know how to talk to the registors and send the data I would like it to
The easiest way to figure that out would be to get a library for another i2c device and use that as a reference to start changing it to do what you want. Talking to any i2c device uses the 'Wire' library in the arduino and they all take about the same form (a begin() function, a read() and write() function)
Please note that the MAX1415 can't produce a 5V Peak signal. Aside from 0V the choices are 10V to 49.5V.
For testing purposes I would start with a potentiometer input so you can adjust the voltage manually:
#include <Wire.h>
const byte MAX14547_Address = 0x77;
void setup()
{
Wire.begin();
Wire.beginTransmission(MAX14547_Address);
Wire.write(0x00); // Set register address to 0
Wire.write(0x01); // Set Register 0 (Sleep Mode) to 'Normal'
Wire.write(0x00); // Set Register 1 (VoltsPeak) to 0V
Wire.endTransmission();
}
void loop()
{
int input = analogRead(A0);
int VPindex = map(input, 0, 1023, 1, 255);
Wire.beginTransmission(MAX14547_Address);
Wire.write(0x01); // Set register address to 1
Wire.write(VPindex); // Set Register 1 to VP index
Wire.endTransmission();
float voltage = 9.5 + 0.1575 * (VPindex - 1);
Serial.print(input);
Serial.print('\t');
Serial.print(VPindex);
Serial.print('\t');
Serial.print(voltage, 4);
delay(500);
}
johnwasser:
Please note that the MAX1415 can't produce a 5V Peak signal. Aside from 0V the choices are 10V to 49.5V.
For testing purposes I would start with a potentiometer input so you can adjust the voltage manually:
#include <Wire.h>
const byte MAX14547_Address = 0x77;
void setup()
{
Wire.begin();
Wire.beginTransmission(MAX14547_Address);
Wire.write(0x00); // Set register address to 0
Wire.write(0x01); // Set Register 0 (Sleep Mode) to 'Normal'
Wire.write(0x00); // Set Register 1 (VoltsPeak) to 0V
Wire.endTransmission();
}
void loop()
{
int input = analogRead(A0);
int VPindex = map(input, 0, 1023, 1, 255);
Wire.beginTransmission(MAX14547_Address);
Wire.write(0x01); // Set register address to 1
Wire.write(VPindex); // Set Register 1 to VP index
Wire.endTransmission();
oribenanson12:
I CAN ALSO USE THE HV892 INSTEAD OF THE MAXIMBOARD (if its not the max14514)
As you can see from the datasheet the HV892 only takes one byte. The value 0 puts it in standby. Values 1 through 255 set the output voltage to 9.8+n*0.205
1 = 10.005V
255 = 62.075V