great to see more and more people interested in this field.
PWM and DAC are two different things.
PWM is a square wave signal where the "on" and "off" time is varied to achieve an overall average voltage.
a DAC is a Digital to Analog Voltage. The output is a constant and steady voltage.
I haven't messed around with DACs a lot, but from the ones that I've heard of, they use multiple op amps and switches to accumulate a voltage with respect to the binary input.
Apart from Atmel, check out Microchip USB devices. I've used the 18f4550 and it's got a lot of tools you can use, especially various sample codes to get you up and running. Some microcontrollers even support internal DAC so that you don't even need to buy a seperate one.
public struct IS_SMALL
{
public const byte Size = 8; // always 8
public byte Type; // always ISP_SMALL
public byte ReqI; // 0 unless it is an info request or a reply to an info request
public byte SubT; // subtype, from SMALL_ enumeration (e.g. SMALL_SSP)
public uint interval; // value (e.g. for SMALL_SSP this would be the OutSim packet rate)
I finally got outgauge to enable. Hopefully the rest will be easy. The reason why I want to write my own app is for learning purposes only, not only that, but the motivation!
My plan is to make a dash using led's and a lcd display. I was able to send data out through the usb port to my usb device the other day, so in theory, it shouldn't be too bad.
again, thanks for the help, I realized I made some stupid programming mistakes, but then again, it was 4am in the morning
yea I don't think it's working whether I set ReqI to either 0 or 1
I'm still geting that random red error text
maybe my laptop is really that slow
as I said, I'm fairly new to c#, so I was just forcing values to variables to ensure they are the storing the values that I want. which was why i set reqi to 0x01
I've attached a .zip of my project. the Initialize Insim button is where all the packet sending takes place. The 2nd packet is suppose to initialise outgauge, which, doesn't work
as I said, I'm just sort of debugging the programming at the moment. Please give me user feedback! I don't have formal training in c# programming, so any tips/hints would be great in debugging methods, better algorithms etc.
I've done Java, so all the concepts of object oriented programming is exactly the same. The only difference is marshalling, which I should have sufficient resource from example codes.
I would really like to take this opportunity as a learning process, and I believe I'm pretty close!
edit. hrm, i think I got it.
i'm not getting the red text anymore after changing the ReqI value to 0
I wrote a small c# app to initialize insim through the udp port.
I'm getting an error saying:
insim: port 30000
insim - udp : unnamed (port 30000)
[RED text] InSim: Packet received before ISI packet
obviously, it did not initialise insim properly.
I've followed the C# tutorial as reference on how to marshal all the data types into a byte packet of size 44
here is my code. Note that I was too lazy to figure out how to marshal the admin and server name, but i suspect that these data values do not matter. so I just set all the bytes to 0
note: please don't laugh at my code, this is more or less my first c# app.
public byte [] initPacket()
{
//create an array for the Insim Initialisation packet
byte[] data = new byte[size];
//size of packet
data[0] = size;
//packet type
data[1] = 0x01;
//ReqI
data[2] = ReqI;
//zero value packet
data[3] = 0;
//UDP Port
data[4] = BitConverter.GetBytes(UDPPort)[0];
data[5] = BitConverter.GetBytes(UDPPort)[1];
The quote DrftMstr posted was a pm from me. Normally, I don't rip out on people like this, especially on the internet, but I just hate it when people try to insult others when things don't go their way. I apologize to everyone for the inconvenience this has caused.
I agree that I should buy S2 to help out the community. I've been following the progress since the beginning stages of LFS, and as an engineering student, I know how much devotion it takes to develop what LFS has come out to be.
As I mentioned, I am an engineering student. Money for me is scrace, and time is definitely of no luxury! I only get to play LFS a handful of times on friday nights. Heck, my laptop can't even run LFS above 30 fps with a few cars on the track. Buying S2 will only be a distraction for me at this point.
Sim racing is what encouraged me to go into engineering. On my spare time, I like to devote my time and experience into things like this: http://youtube.com/watch?v=8ZKv0dJCjiA in which I hope to make this project open source to expand the possibilities of this project.
I hope that people understand this post more clearly. Encouraging people to help LFS grow is a great thing, but I don't think insulting others is the way to go.
I've been practicing for so long until I switched to a setup. I became so frustrated because I knew that setup had potential but I my laptimes were even worse.
Finally, I decided to lower the braking force, and I was able to corner so much smoother, until I finally got
hrm, some guy online who can get 1:13's consistently suggested that I turn into the apex while braking into the corner.
Problem is that I'm using mouse and once I try to turn, my wheels sort of lock up and straighten out and it starts to get really difficult to control the car where as just braking ina strait line, letting go fo the brakes and turning.
man, I just tried some guys setup who got 1:13:10 on it and I just find it so difficult to drive with that setup! I spin out so easily and I have no clue how to accelerate when exiting a corner.
Yea, this is exactly what I did. Got a few contacts doing so. It's really nice how we're all a small community and we all know each other like back in the days of the BETA versions.