LOGIN
Steven Reubenstone
Mechanical Engineer & Collaborizm Mentor. Join our iOT Hackathon! (Project Leader)
 · New YorkU.S.
Edit
Delete
Share
Report
QUESTION
  ·  Mark as Answered

Some Code I Need Help With

…I am currently wiring up my bluetooth module to my Arduino, which is connected to an H-Bridge. I diagrammed everything, uploaded the code, and ran it…but nothing is happening.


SoftwareSerial Genotronex(10, 11); // RX, TX
int ledpin=13; // led on D13 will show blink on / off
int BluetoothData; // the data given from Computer

void setup() {
  // put your setup code here, to run once:
  Genotronex.begin(9600);
  Genotronex.println("Bluetooth On please press 1 or 0 blink LED ..");
  pinMode(ledpin,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
   if (Genotronex.available()){
BluetoothData=Genotronex.read();
   if(BluetoothData=='1'){   // if number 1 pressed ....
   digitalWrite(7,HIGH);
   Genotronex.println("LED  On D13 ON ! ");
   }
  if (BluetoothData=='0'){// if number 0 pressed ....
  digitalWrite(7,LOW);
   Genotronex.println("LED  On D13 Off ! ");
  }
}
delay(100);// prepare for next data ...
} 

I am struggling a bit with this. Does anyone have familiarity with TESTING this code? I can not tell if its a CODE issue or HARDWARE issue. Your help is greatly appreciated!!

2 likes 
Like
Share
Nouman Tahir
Founder and Developer Lead at HawkDev
 · SargodhaPakistan
Edit
Delete
Share
Report

Hye, just read you project, I really wanna be a part of this project, I am more experienced in Android Application development but can surely help out in Arduino with ease.

For the current posted code, I believe you are not receiving the expected data from you BT chip, print it console on console to see what you are receiving. For hardware, check the pin output using some DMM perhaps.

1 like 
Leave a reply...
DISCOVER
CHAT
ALERTS
-2
DISCUSSIONS
-1
FEED