arduino-uno


Execute line by line Arduino


I have a C program which send information (like that 134:12) line by line to arduino. Arduino gets this information but only executes the first line... I think it's a problem with \n
How can I solve my problem?
C program
FILE *file;
file = fopen("/dev/cu.usbmodem1421","w"); //Opening device file
fprintf(file,"%s",argv[2]); //Writing to the file
usleep(1);
fclose(file);
Arduino program
while(Serial.available() == 0);
String val = Serial.readString();
String posServo1 = getValue(val, ':', 0);
int posServo1Int = posServo1.toInt();
String posServo2 = getValue(val, ':', 1);
int posServo2Int = posServo2.toInt();
Serial.println(posServo1Int);
Serial.println(posServo2Int);
servo1.write(posServo1Int);
servo2.write(posServo2Int);

Related Links

Arduino UNO(9600) with Wizfi250 cannot send data to Ubidots
How to wire a 12V double solenoid to an Arduino?
Receiving data automatically in wifi(ESP8266) Even though connected my mobile with ESP8266
How to copy string (char*) from Flash to RAM with strcpy_P
LED's won't light up with Arduino
Every function executes on Arduino reset
What is the output of this arduino code?
Shield L6474 and motor equiped with a reducer
NRF24L01+PA+LNA (Transciever) not communicating between two arduinos
Can't program Arduino 328P after first time use of ICSP Sparkfun AVR Pocket Programmer
Arduino uploading issue: “avrdude: no programmer has been specified on the command line or the config file”
Code is showing multiple object declaration error during multiple file compilation
arduino wifi upload google spreadsheet
How to solve error compiling an arduino sketch?
load image in the TFT lcd screen without SD card
how to send dummy data on gpio pins of arduino uno.?

Categories

HOME
osgi
variables
vbscript
nullpointerexception
fft
dot
alfresco
gis
cvs
sqlite-net-extensions
razor
jpeg
callback
azure-media-services
android-youtube-api
contact
vifm
here-api
user-input
floating-action-button
leiningen
serilog
propel
alpine
dbext
plunker
cx-freeze
errorlevel
mmap
microsoft-r
sqlcipher
social-media
neo4j-spatial
assistant
directx-10
bosh
xquery-3.0
airconsole
google-qpx-express-api
typed.js
hybridauth
windows-dev-center
mapbox-gl
html5-fullscreen
fusionpbx
revolution-slider
gesture
withings
service-discovery
tasker
squib
google-closure
botbuilder
midl
segment
btrace
scrollable
smartcontracts
revapi
jedis
react-scripts
celery-task
ionicons
typescript1.8
statsd
windows-iot-core-10
mcafee
django-scheduler
specrun
time-and-attendance
slicknav
measures
qpid
sigabrt
skype4py
livequery
revolution-r
wapiti
django-unittest
drawbitmap
ionic
event-bubbling
vstest.console.exe
e10s
rake-task
gadt
tt-news
applescript-objc
gulp-less
flask-cors
xojo
openexr
reactfx
didselectrowatindexpath
page-layout
google-cloud-save
coverflow
easy-install
ora-00911
chronoforms
sabredav
smtp-auth
quickdialog
word-processor
parametric-equations
chrono
genshi
coercion
appender
krl
gdlib
android-sdk-2.1
visitor-statistic
yslow
subviews
createwindow
sproutcore-2
asp.net-profiles
microsoft-virtualization
avatar
noscript
project-hosting
paul-graham

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App