writing to terminal with variable - Raspberry Pi Forums


i writing small program control servo via gyro , stuck...
do:
- loop writing terminal , executing command variable

example write in shell script mean:

code: select all

#!bin/bash  in {1..10}    echo "write $i times" done
, working fine.

in c# try:

code: select all

for(i=1;i<10;i++){ std::system("write $i times"); }
not work variable, without $i ok

som idea or solution how that?

best,
pawel

don't know c#.

in c you'd like.

code: select all

char str[8]; int i;  (i=1;i<10;i++) {    sprintf(str, "write %d times", i);    system(str); } 


raspberrypi



Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial