horace's Profile User Rating: *****

Reputation: 535 Enlightened
Active Posts:
2,828 (0.85 per day)
25-October 06
Profile Views:
Last Active:
User is offline Nov 15 2015 12:31 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:

Latest Visitors

Icon   horace has not set their status

Posts I've Made

  1. In Topic: Vowel Counter using Call by Reference

    Posted 15 Nov 2015

    if you wish to read a complete line from the file rather than individual words you can use getline()
    	while (getline(inFile, words))
  2. In Topic: Write C program to calculate resistance

    Posted 15 Nov 2015

    View Postanchoorimani, on 15 November 2015 - 08:01 AM, said:

    I have also done the same program but how to convert resistance from ohms to KILO-ohms.... Please can anyone suggest me how to do as soon as possible by today....:)/>

    a killo ohm is 1000 ohms therefore divide by 1000
  3. In Topic: Make graph from serial data input

    Posted 13 Nov 2015

    if you wish to plot a graph you could use the Chart component in the toolbox
  4. In Topic: trouble with while loop

    Posted 5 Nov 2015

    View Postjrice79, on 05 November 2015 - 07:08 AM, said:

    I am using a while loop to gather input. I want the loop to exit when the user hits enter. Since I am not using a string as my input, I am not sure how to do this. Please help

    you could use readLine() - on Enter an empty String would be returned and you can exit the program
    otherwise you scan the String for an integer, e.g.
                String s=sc.nextLine();
                if(s.equals("")) return;
                Scanner sc1=new Scanner(s);
                item = sc1.nextInt();

    you should also check if a non integer String is entered
    an alternative to creating a new Scanner is to use Integer.ParseInt() or similar
  5. In Topic: Java class send command DataOutputStream

    Posted 3 Nov 2015

    I would usually do this in C but in Java to get the XOR of the data I would suggest something along the lines of
        String data="OPC1,1";
        int xor=0, i;
            xor ^= data.charAt(i);
        System.out.println("xor " + xor);

    which gives 112 decimal (70 hexadecimal)

    I think the data length would be 11 bytes, e.g. frame is so
    0xBF, 0xFB 0X70 11 0 'O' 'P' 'C' '1' ',' '1'

    with the length in little endian format

My Information

Member Title:
D.I.C Lover
Age Unknown
Birthday Unknown
Norwich UK
C/C++ including embedded code for dsPIC, PIC24, PIC32 and TMS320C6711
C#, VB.NET, Java
client/server applications using TCP, UDP, RMI, etc
Computer hardware, microcontrollers, interfacing, e.g. I2C, SPI, CANBUS, etc
Years Programming:
Programming Languages:

Contact Information

Website URL:
Website URL  http://


Page 1 of 1
  1. Photo

    GautamMohan Icon

    20 Sep 2015 - 01:12
    I want to know how to code to communicate between two single board computers. In my industry we used Fastwel, Octagon system single board computers. We use Rs-485 for communication between these processors. What is the best way to start. I have knowledge on basic and c++ programming but hardware to hardware interaction i have no idea. Please help on learning this aspect.
  2. Photo

    GautamMohan Icon

    20 Sep 2015 - 01:11
  3. Photo

    R@HUL Icon

    18 Jul 2015 - 00:13
    hey can you check your inbox please...
  4. Photo

    roosh.t3 Icon

    19 Jun 2015 - 23:42
    Hey, I need a help in C++, if you're willing to give a help :)
  5. Photo

    macosxnerd101 Icon

    31 May 2015 - 21:22
    Welcome back, horace! It's great to see you around DIC again. :-)
Page 1 of 1