View unanswered posts | View active topics It is currently Sun Oct 22, 2017 8:07 am






Reply to topic  [ 2 posts ] 
Error Mismatched typedefs. Converting typedef 'char' to type 
Author Message
Rookie

Joined: Mon Apr 04, 2016 10:49 am
Posts: 1
Post 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)



Mon Apr 04, 2016 10:57 am
Profile
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post 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.


Tue Apr 05, 2016 9:01 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.