Skip to content
Snippets Groups Projects
Commit b1d746f8 authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

Fixing Json writing problems

parent eccf46bf
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
......@@ -10,10 +10,10 @@ Syringe syringe;
//CONSTRUCTOR
Syringe :: Syringe()
{
//set_syringe("BD_10mL", "300912","BD", 10, 14.5);
set_syringe("BD_10mL", "300912","BD", 10, 14.5);
set_syringe("Terumo_5mL", "0197","Terumo", 5, 10);
syringe_json["BD_10mL"] = 10;
syringe_json["nom"] = "bidule";
set_syringe("Terumo_2mL", "0197", "Terumo", 2, 3);
set_syringe("FisherBrand_1mL", "1234", "FisherBrand", 1, 0.5);
}
......@@ -21,7 +21,6 @@ Syringe :: Syringe()
//SET METHODS
void Syringe :: set_syringe(String name, String ref, String brand, float total_volume_mL, float internal_diameter_mm)
{
syringe_json["name"] = name;
set_ref(name, ref);
set_brand(name, brand);
set_total_volume_mL(name, total_volume_mL);
......@@ -109,9 +108,9 @@ void Syringe :: write_Json ()
-Action : Save the Json structure in a file (convert it to text)
***/
{
//InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code)
//File f = filesystem->open("syringe_json", "w"); //Creation du fichier
serializeJson(syringe_json, Serial); //remettre f a la plce de json
InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code)
File f = filesystem->open("syringe_json", "w"); //Creation du fichier
serializeJson(syringe_json, f); //remettre f a la plce de json
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment