Arduino interfacing

Open a thread for a question about the simulator control software.
If you cannot receive any data in the input setup use the upper two forums!

Arduino interfacing

Postby AirGears » Mon 17. Mar 2014, 20:07

I have managed to get X-Sim to talk to my Arduino controller, I am sure that they are communicating, but I do not know what it is sending, I have tried to display it on an LCD screen and I only get white boxes, I am inexperienced with this subject but am eager to learn, thanks in advance for any assistance
AirGears
 
Posts: 4
Joined: Thu 19. Dec 2013, 19:01
Has thanked: 0 time
Been thanked: 0 time

Re: Arduino interfacing

Postby dennisnojack » Mon 17. Mar 2014, 20:31

Give me more information. for example code with comments, and the uso config etc.
dennisnojack
 
Posts: 53
Images: 10
Joined: Sat 11. Jan 2014, 07:03
Location: Germany - Hessen - Solms
Has thanked: 1 time
Been thanked: 2 times

Re: Arduino interfacing

Postby AirGears » Mon 17. Mar 2014, 20:53

const int ledPin = 13;
int incomingByte;
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
//general setup for inputs and variables
void setup() {
lcd.begin(16, 2);//begins use of LCD screen
lcd.clear();//clears LCD screen prior to program that way there is no old information on it
Serial.begin(9600);//begins serial communication with the computer
}

void loop() {
if (Serial.available() > 0) {//if serial communication is available:
incomingByte = Serial.read();//read what is being sent through serial and save it as variable incomingByte
lcd.write(incomingByte);//write incomingByte on LCD screen
}
if (millis() >5000) {
lcd.clear();//clear LCD screen every 5 seconds to allow new information to display
}
}
that is my code for Arduino
and this should be a picture of X-Sim as it is, if it displays, if not ill have to find another way to make it do so
Attachments
AirGears
 
Posts: 4
Joined: Thu 19. Dec 2013, 19:01
Has thanked: 0 time
Been thanked: 0 time

Re: Arduino interfacing

Postby dennisnojack » Mon 17. Mar 2014, 21:10

Ok. I see.

Here is a good very Tutorial for a dashboard. Modify the code for LCD use ;-)
viewtopic.php?f=40&t=155
dennisnojack
 
Posts: 53
Images: 10
Joined: Sat 11. Jan 2014, 07:03
Location: Germany - Hessen - Solms
Has thanked: 1 time
Been thanked: 2 times


Return to Converter questions

Who is online

Users browsing this forum: No registered users and 2 guests