LOGIN
Steven Reubenstone
41
Community Expert
Mechanical Engineer & Tinkerer of Things. Community Moderator. (Project Leader)
 · New YorkU.S.
Share
Report
Get Link
QUESTION
Open

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
Award Contribution
Nouman Tahir
20
Community Expert
Android/iOS Contractor - Google Certified
 · IslamabadPakistan
Share
Report
Get Link

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.

Like
1 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
Chat with us!
Help
Write something before you submit it!
Photo updated
Request Sent!
Updated
Copied to Clipboard