Hello Guest it is April 19, 2024, 05:58:17 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nokialkatel

Pages: 1 2 »
1
Modbus / Re: Modbus and Arduino Question
« on: February 05, 2017, 06:58:55 PM »
Send code og brain to me..thanks

2
Modbus / Re: Modbus and Arduino Question
« on: February 05, 2017, 05:41:18 PM »
Keyboard matrix is best to one analog pin ..
Din lcd dro format ...is it 0.00 or 0.0000

3
Modbus / Re: Modbus and Arduino Question
« on: January 31, 2017, 04:53:57 PM »
POSTED..Remember to change your i2c address for lcd

4
Modbus / Re: Modbus and Arduino Question
« on: January 31, 2017, 04:47:58 PM »
Code: [Select]
// Modbus:
#include <SimpleModbusSlave.h> //http://code.google.com/p/simple-modbus/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

const int HOLDING_REGS_SIZE = 22; // I use 22 registers, first 11 for sendidng info to Mach3
//and next 11 registers for receiving info from Mach3
unsigned int holdingRegs[HOLDING_REGS_SIZE]; // function 3 and 16 register array

int rcd[11]; //holds sending info
int mcd[11]; //holds received info

void setup(){

  pinMode(13, OUTPUT); //indicator LED

  modbus_configure(&Serial, 115200, SERIAL_8N2, 2, 13, HOLDING_REGS_SIZE, holdingRegs);
//2 is slave address, 13 is indicator led pin (useless)
 lcd.begin(20,4);         // initialize the lcd for 20 chars 4 lines, turn on backlight
 lcd.print("Hello, ARDUINO ");  
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print (" FORUM - fm   ");
  delay ( 1000 );
  
}

void loop(){

  //Reads buttons:
  if(digitalRead(4) == 1) bitSet(rcd[0],0);
  else bitClear(rcd[0],0);

  if(digitalRead(5) == 1) bitSet(rcd[0],1);
  else bitClear(rcd[0],1);

  if(digitalRead(6) == 1) bitSet(rcd[0],2);   //can be up to 15
  else bitClear(rcd[0],2);

  //Potens´iometers:
  rcd[3] = analogRead(A0);
  rcd[4] = analogRead(A1);

  //Other variables:
  rcd[1] = 0x1111;
  rcd[2] = 0x2222;
  rcd[5] = 0x3333;
  rcd[6] = 32767;
  rcd[7] = 12345;
  rcd[8] = 54321;
  rcd[9] = 0;
  rcd[10] = 1;


  //Sending and receiving info:
  for (int i=0; i < 11; i++)
    holdingRegs[i] = rcd[i];

  modbus_update();

  for (int i=0; i < 11; i++)
    mcd[i] = holdingRegs[i+11];

  // Writes cordinates to LCD:
   float Xpos = mcd[0]+(mcd[1]/100.00);
   float Ypos = mcd[2]+(mcd[3]/100.00);
   float Zpos = mcd[4]+(mcd[5]/100.00);
  
   lcd.setCursor( 0,0 );
   lcd.print("                ");
   lcd.setCursor( 0, 0 );
   lcd.print("X");
   lcd.setCursor( 1, 0 );
   lcd.print(Xpos);
   lcd.setCursor( 0, 1 );
   lcd.print("                ");
   lcd.setCursor( 0, 1 );
   lcd.print("Y");
   lcd.setCursor( 1, 1 );
   lcd.print(Ypos);
   lcd.setCursor( 0, 2 );
   lcd.print("                ");
   lcd.setCursor( 0, 2 );
   lcd.print("Z");
   lcd.setCursor( 1, 2 );
   lcd.print(Zpos);
   lcd.setCursor(0, 3);
   lcd.print("                ");
   lcd.setCursor(0, 3);
   lcd.print("A");
  
  

}
  

5
Modbus / Re: Modbus and Arduino Question
« on: January 31, 2017, 04:44:19 PM »
SEND MY YOUR MAIL

6
Modbus / Re: Modbus and Arduino Question
« on: January 31, 2017, 04:39:38 PM »
How you is conected lcd to arduino.is it i2c or serial or parallel lcd

7
Modbus / Re: Modbus and Arduino Question
« on: January 31, 2017, 06:05:01 AM »
I can help with brans but I need arduino code...

8
Modbus / Re: Simple tutorial on analog inputs with Arduino
« on: January 27, 2017, 04:45:59 AM »
Ok.thanks! I am waiting.
Can not find villy's code.

9
Modbus / Re: Simple tutorial on analog inputs with Arduino
« on: January 19, 2017, 04:24:18 PM »
Are you home Zafarsallam?

10
Modbus / Re: Simple tutorial on analog inputs with Arduino
« on: January 14, 2017, 06:11:52 PM »
hi! I need help from you zafarsalam

How to setup dro info on lcd connected to arduino modbus slave on arduino with shillings code modbus slave???

Ihave included wire.h and liquidcristali2c.h for lcd in arduino code.
From now I ned help for how to send data from mach3 -->>>brain-->>serial modbus plugin--->>>arduino modbus slave ?????
many users have this done but no documentation on arduino code, no info about serial plugin configs,

Help  and thanks

Pages: 1 2 »