ROBOTC.net forums
http://robotc.net/forums/

Error Mismatched typedefs. Converting typedef 'char' to type
http://robotc.net/forums/viewtopic.php?f=11&t=13832
Page 1 of 1

Author:  sergio.mares [ Mon Apr 04, 2016 10:57 am ]
Post subject:  Error Mismatched typedefs. Converting typedef 'char' to type

Hello, Im programming a elevator for my preengineering class and im having some problems. Im getting the error Mismatched typedefs. Converting typedef 'char' to typedef 'tSensors', value 'in2' but I don't really understand what It means

Im using a sonar sensor that would tell me the height of the the elevator and that would determined ( plus pressing a bump switch) where its going.

Its simple programming but I have no idea.

Code:
#pragma config(Sensor, dgtl1,  green,          sensorLEDtoVCC)
#pragma config(Sensor, dgtl2,  yellow,         sensorLEDtoVCC)
#pragma config(Sensor, dgtl3,  red,            sensorLEDtoVCC)
#pragma config(Sensor, dgtl4,  sonar,          sensorSONAR_inch)
#pragma config(Sensor, dgtl6,  bump1,          sensorTouch)
#pragma config(Sensor, dgtl7,  bump2,          sensorTouch)
#pragma config(Sensor, dgtl8,  bump3,          sensorTouch)
#pragma config(Motor,  port3,           motor1,        tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   while(1==1)
   {
if(SensorValue(sonar)<4&&((bump2)==(1)))
      {
         startMotor(motor1,63);
         untilSonarGreaterThan(4,sonar);
         stopMotor(motor1);
      }
   }
}

      //{
      //   if(SensorValue(sonar)<4&&((bump3)==(1)))
      //   {
      //      startMotor(motor1,63);
      //      untilSonarGreaterThan(7,sonar);
      //      stopMotor(motor1);
      //   }
         //{
         //   if(Sensorvalue(sonar)>=4&&(bump1)==1)))
         //   {
         //      startMotor(motor1,-63)
         //      untilSonarLessThan(1)


Author:  CARBOT [ Tue Apr 05, 2016 9:01 pm ]
Post subject:  Re: Error Mismatched typedefs. Converting typedef 'char' to

try replacing
if(SensorValue(sonar)<4&&((bump2)==(1)))
with
if ((SensorValue[sonar] < 4) && (bump2 == 1))
good luck.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/