From b90204dc1a43b2d9144550f7203e7357755f42a4 Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 26 Mar 2021 17:03:02 +0100 Subject: [PATCH 1/3] fix testsending --- .../testsender/testsender.pde | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/logdata_visualization/testsender/testsender.pde b/logdata_visualization/testsender/testsender.pde index 0208bbe..4a449b1 100644 --- a/logdata_visualization/testsender/testsender.pde +++ b/logdata_visualization/testsender/testsender.pde @@ -69,14 +69,14 @@ void draw() { if (loopmillis>last_send+20) { last_send=loopmillis; - String wstring=time+","+cmd_FrontL+","+cmd_FrontR+","+cmd_RearL+","+cmd_RearR+","+current_FrontL+","+current_FrontR+","+current_RearL+","+current_RearR+","+speed_FrontL+","+speed_FrontR+","+speed_RearL+","+speed_RearR+","+temp_Front+","+temp_Rear+","+vbat_Front+","+vbat_Rear+","+currentAll+","+throttle+","+brake+"\n"; + String wstring=time+","+cmd_FrontL+","+cmd_FrontR+","+cmd_RearL+","+cmd_RearR+","+nfc(current_FrontL,3)+","+nfc(current_FrontR,3)+","+nfc(current_RearL,3)+","+nfc(current_RearR,3)+","+speed_FrontL+","+speed_FrontR+","+speed_RearL+","+speed_RearR+","+nfc(temp_Front,2)+","+nfc(temp_Rear,2)+","+nfc(vbat_Front,2)+","+nfc(vbat_Rear,2)+","+nfc(currentAll,3)+","+throttle+","+brake+"\n"; serial.write(wstring); print(wstring); } if (loopmillis>last_update+20) { last_update=loopmillis; - n1+=0.1; + n1+=0.02; time=loopmillis/1000.0; updateValues(); } @@ -86,14 +86,14 @@ void draw() { void updateValues() { - cmd_FrontL=int(noise(n1,0)*1000); - cmd_FrontR=int(noise(n1,0.001)*1000); - cmd_RearL=int(noise(n1,0.02)*1000); - cmd_RearR=int(noise(n1,0.021)*1000); - current_FrontL=noise(n1,2)*10-3; - current_FrontR=noise(n1,2.001)*10-3; - current_RearL=noise(n1,2.02)*10-3; - current_RearR=noise(n1,2.021)*10-3; + cmd_FrontL=int(noise(n1,2)*1000); + cmd_FrontR=int(noise(n1,2.001)*1000); + cmd_RearL=int(noise(n1,2.02)*1000); + cmd_RearR=int(noise(n1,2.021)*1000); + current_FrontL=noise(n1-5,2)*10-3; + current_FrontR=noise(n1-5,2.2)*10-3; + current_RearL=noise(n1-5,2.4)*10-3; + current_RearR=noise(n1-5,2.6)*10-3; speed_FrontL=int(noise(n1,5)*600); speed_FrontR=int(noise(n1,5.001)*600); speed_RearL=int(noise(n1,5.02)*600); @@ -102,7 +102,7 @@ void updateValues() { temp_Rear=noise(n1/100.0,10.1)*3+30; vbat_Front=-noise(n1/100.0,11)*4+12*4.2; vbat_Rear=-noise(n1/100.0,11.2)*4+12*4.2; - currentAll=min(current_FrontL,current_FrontR,min(speed_RearL,speed_RearR)); + currentAll=min(current_FrontL,min(current_FrontR,min(speed_RearL,speed_RearR))); throttle=int(noise(n1,15)*1000); brake=max(0,int(noise(n1,18)*1000-800)); } From 48ebf40656ea516e58dbae12be31fdfa65fcbfbf Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 26 Mar 2021 18:04:51 +0100 Subject: [PATCH 2/3] add readme for hc12 and openlog notes --- logdata_visualization/README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/logdata_visualization/README.md b/logdata_visualization/README.md index 8d5e348..90dbd9c 100644 --- a/logdata_visualization/README.md +++ b/logdata_visualization/README.md @@ -5,4 +5,30 @@ This processing software can display log information from the bobbycar in realim It is used alongside the controller_teensy firmware. Log information is constantly printed out on one serial interface and can be written either to an sd card or transmitted via rf or bluetooth. -![screenshot](Screenshot.png "Screenshot") \ No newline at end of file +![screenshot](Screenshot.png "Screenshot") + + +## OpenLog + +Tutorial for OpenLog Serial SD Card logger: https://learn.sparkfun.com/tutorials/openlog-hookup-guide/configuration-file + +Only works reliable on 3v3. +Using 5v restarts occur (prints 12> over serial and everytime a new file is created). + + +my CONFIG.TXT content: +115200,26,3,0,1,1,0 +baud,escape,esc#,mode,verb,echo,ignoreRX + + +## HC12 433MHz Module +5v or 3v3. +Bridge Set pin to ground and power up to enter setup mode. +Use Arduino IDE to send commands via serial terminal with 9600 Baud. +AT+RX shows current settings. + +Use following commands to setup: +AT+B115200 +AT+C002 + +Using channel 2 instead of 1, because 1 receive didnt work with two computers. From a4dc138da1e4fdcf49bcb5cc1c8f5d03877cb1e1 Mon Sep 17 00:00:00 2001 From: Fisch Date: Fri, 26 Mar 2021 19:57:08 +0100 Subject: [PATCH 3/3] fix sending --- logdata_visualization/testsender/testsender.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logdata_visualization/testsender/testsender.pde b/logdata_visualization/testsender/testsender.pde index 4a449b1..c79b7bb 100644 --- a/logdata_visualization/testsender/testsender.pde +++ b/logdata_visualization/testsender/testsender.pde @@ -102,7 +102,7 @@ void updateValues() { temp_Rear=noise(n1/100.0,10.1)*3+30; vbat_Front=-noise(n1/100.0,11)*4+12*4.2; vbat_Rear=-noise(n1/100.0,11.2)*4+12*4.2; - currentAll=min(current_FrontL,min(current_FrontR,min(speed_RearL,speed_RearR))); + currentAll=min(current_FrontL,min(current_FrontR,min(current_RearL,current_RearR))); throttle=int(noise(n1,15)*1000); brake=max(0,int(noise(n1,18)*1000-800)); }