Hi John, and thanks for the answers.
1 -
THis line, BrickPi.MotorSpeed[PORT_A]=200; means you’re setting the motor on Port A to 200 power (out of a max of 255).
Ok - I got that. But for how long?
To me, it seems like it moves when I
call BrickPiUpdateValues();
BUT, just for a short while.
The code above calls
BrickPi.MotorSpeed[PORT_A]=200;
BrickPiUpdateValues();
in a loop.
That, I guess, I s really my question.
How do I get it to run continuously?
And more interestingly, what is the trick to makes it rotate a fixed number of degrees?
2 - sorry if I was unclear.
I have 4 touchsensors and 2 light-sensors.
And I cannot get resonanble readings from any of them.
I connect the touchsensor to S1,
and run
it loops and prints the sensor input on screen, but its about 90 % 1’s and 10 % 0’s. even if I don’t touch the button. And it makes no difference if I press the button. still same distribution 90/10
For the light sensor I’ve tested
which also gives me random results.
I then tried
https://github.com/DexterInd/BrickPi_C/blob/master/Sensor_Examples/General%20-%20AnalogSensor%20test.c
But that did not light the leds up.
That I guess is bad. (seem to remember that from my rcx at the turn of the millennium. Yes, I’m that old)
The sensors I have are number two and three in
the second picture
3 - Error message from unpowered brickpi,
does it show even if DEBUG is not defined ?
looking at BrickPiRx in BrickPi.h I only see
num bytes received if debug is enabled.
That is 8 or 11 alternatively if I remember correctly
(at work now)
(im using BrickPi.H at
)
the BrickPi is powered from external 9v battery, but it is attached to the Raspberry Pi. Does not the mcus of the brickpi pick power from the raspberry?
I see a wonderful product here, but I miss some notes about how to use the api - more than the code samples.
I’m building a Tic-Tac-Toe bot.
I once did that with the rcx in Lejos, so that is fairly familiar grounds. Not using Lejos this time though.
/Björn