Search This Blog

Friday, 20 November 2020

joystick module with ARDUINO nano||how to use ARDUINO nano with joystick module||the robotics guy||Lucifer

Code for the Arduino
/*How to use the joystick module.
 *Serial monitor readings.
 *Read the code below and use it for any of your creation
 */
 
void setup() {
  Serial.begin(9600);//enable serial monitor
}
void loop() {
  int joy = analogRead(A0);//get analog value (0-1024)
  int joy1 = analogRead(A1);//get analog value (0-1024)
  String x = "x axis ";//creating string variable
  String y = "y axis ";//creating string variable
  Serial.print(x + joy);//print x axis value
  Serial.print("\t");//tab space
  Serial.println(y + joy1);//print y axis value
  Serial.println( "");//space
  delay(100);//delay
}

No comments:

Post a Comment

interfacing ph sensor with arduino

You will need to connect the pH sensor to the Arduino board and configure the pins accordingly. Refer to the documentation of your pH se...