Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ROBOTIS-GIT/OpenCR
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBOTIS-Will committed Jun 17, 2022
2 parents bad3165 + 0f0e978 commit 3a12524
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arduino/opencr_arduino/opencr/libraries/OLLO/OLLO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int OLLO::read(int devNum, OlloDeviceIndex device_index){ // IR SENSOR, Button,
return average_value;
}else if(device_index == TEMPERATURE_SENSOR){
analogValue = analogRead(PORT1_ADC);
vvalue = (4095 - analogValue) * 10000 /analogValue;
vvalue = (1023 - analogValue) * 10000 /analogValue;
for(scount = -20; scount < 140; scount++){
if(vvalue > gwTheRmistor[scount +20]){
return scount;
Expand Down Expand Up @@ -291,7 +291,7 @@ int OLLO::read(int devNum, OlloDeviceIndex device_index){ // IR SENSOR, Button,
}
else if(device_index == TEMPERATURE_SENSOR){
analogValue = analogRead(PORT2_ADC);
vvalue = (4095 - analogValue) * 10000 /analogValue;
vvalue = (1023 - analogValue) * 10000 /analogValue;
for(scount = -20; scount < 140; scount++){
if(vvalue > gwTheRmistor[scount +20]){
return scount;
Expand Down Expand Up @@ -323,7 +323,7 @@ int OLLO::read(int devNum, OlloDeviceIndex device_index){ // IR SENSOR, Button,
return average_value;
}else if(device_index == TEMPERATURE_SENSOR){
analogValue = analogRead(PORT3_ADC);
vvalue = (4095 - analogValue) * 10000 /analogValue;
vvalue = (1023 - analogValue) * 10000 /analogValue;
for(scount = -20; scount < 140; scount++){
if(vvalue > gwTheRmistor[scount +20]){
return scount;
Expand Down Expand Up @@ -356,7 +356,7 @@ int OLLO::read(int devNum, OlloDeviceIndex device_index){ // IR SENSOR, Button,
return average_value;
}else if(device_index == TEMPERATURE_SENSOR){
analogValue = analogRead(PORT4_ADC);// 2014-04-17 shin
vvalue = (4095 - analogValue) * 10000 /analogValue;
vvalue = (1023 - analogValue) * 10000 /analogValue;
for(scount = -20; scount < 140; scount++){
if(vvalue > gwTheRmistor[scount +20]){
return scount;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* OLLO TPS Sensor Read
connect Temperature Sensor to OLLO ports
Compatibility
CM900 X
OpenCM9.04 O
created 16 Nov 2012
by ROBOTIS CO,.LTD.
*/

#include <OLLO.h>
OLLO myOLLO;

#define YOUR_OLLO_PORT 3

void setup(){
myOLLO.begin(YOUR_OLLO_PORT);// A Module needs to be connected to proper port (PORT 1 to 4)
}
void loop(){
Serial.print("RAW Temperature = ");
Serial.print(myOLLO.read(YOUR_OLLO_PORT)); //read ADC value from YOUR_OLLO-PORT
Serial.print("\t Converted Temperature = ");
Serial.println(myOLLO.read(YOUR_OLLO_PORT, TEMPERATURE_SENSOR)); //read ADC value from YOUR_OLLO-PORT
delay(100);
}



Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ void TurtleBot3Core::begin(const char* model_name)
ret = controllers.init(max_linear_velocity, max_angular_velocity);
DEBUG_PRINTLN(ret==true?"RC100 Controller setup completed.":"RC100 Controller setup failed.");


// Port begin
dxl_slave.begin();
// Init DXL Slave function
dxl_slave.setPortProtocolVersion(PROTOCOL_VERSION_DXL_SLAVE);
dxl_slave.setFirmwareVersion(FIRMWARE_VER);
Expand Down

0 comments on commit 3a12524

Please sign in to comment.