You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have wanted to do this for a long time, and the debugging with Shepherd that we did has made me realize how important it would be to know that for certain that the logic in the lowcar code actually works. One idea that that I've had is the following:
Create some sort of "fake Arduino.h" which defines all of the functions that we currently use on the Arduinos, like Serial.begin(), Serial.read, Serial.write, pinMode, digitalWrite, digitalRead, analogWrite, analogRead, delay, and maybe a few others. But essentially, we would create a fake Arduino header which the lowcar code would include, and when it called Serial.write, it would actually be printing into a buffer or something for us to check later; when it calls digitalWrite it writes it to some state which we can use to check that the code actually writes to the desired pin, etc.
Make a wrapper that runs the lowcar code the way it's supposed to be run, i.e. run the setup function once, then run the loop function indefinitely. We may need to throttle the loop to simulate running on the 16 MHz chips on the Arduinos
Come up with some general-ish way to test the lowcar code, or at least the messaging protocol with some of the more basic lowcar devices where we can write a test case that sends commands to the code (mimicking dev_handler) and also provides data on the pins as needed (mimicking pin readings on the Arduino), and then can check the outputs by reading the outputs on the serial connection and also the outputs to the pins.
This is likely going to be a big project for whoever wants to try to do it. But this would be a really great addition to the Runtime library, or even downright necessary if we are going to make lowcar it's open repo over the summer and import it into Runtime as a submodule.
The text was updated successfully, but these errors were encountered:
I have wanted to do this for a long time, and the debugging with Shepherd that we did has made me realize how important it would be to know that for certain that the logic in the lowcar code actually works. One idea that that I've had is the following:
Serial.begin()
,Serial.read
,Serial.write
,pinMode
,digitalWrite
,digitalRead
,analogWrite
,analogRead
,delay
, and maybe a few others. But essentially, we would create a fake Arduino header which the lowcar code would include, and when it calledSerial.write
, it would actually be printing into a buffer or something for us to check later; when it callsdigitalWrite
it writes it to some state which we can use to check that the code actually writes to the desired pin, etc.setup
function once, then run theloop
function indefinitely. We may need to throttle the loop to simulate running on the 16 MHz chips on the Arduinosdev_handler
) and also provides data on the pins as needed (mimicking pin readings on the Arduino), and then can check the outputs by reading the outputs on the serial connection and also the outputs to the pins.This is likely going to be a big project for whoever wants to try to do it. But this would be a really great addition to the Runtime library, or even downright necessary if we are going to make
lowcar
it's open repo over the summer and import it into Runtime as a submodule.The text was updated successfully, but these errors were encountered: