Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
Six of the Arduino 'C' sample programs have been converted over to BASCOM and are available below. The resulting code is more compact, and when controlling I/O Pins runs faster than Arduino 'C'. Plus the absence of 'extra characters' makes it perfect for learning, but it is equally well suited to serious control applications. BASCOM also offers integrated commands for LCDs Char/Graphic, I2C chips, 1WIRE chips, Keypads, RC5, RC6, software UARTs, SPI and much more. No searching for libraries and then trying to adapt them....Side by side comparison of code will help the user see the differences. Of the 6 Arduino examples that have been converted, two are shown below - all comments had to be removed for space reasons. The totals of bytes used over all 6 examples suggest that the BASCOM demo will allow the equivalent of 14,500 bytes of Arduino 'C' code. Arduino Example: 'Blink' int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); } void loop(){ digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } '1112 bytes BASCOM Example: 'Blink'$Include "DuinoLib.inc"Config Pin13 = OutputDo Set Out13 WaitmS 1000 Reset Out13 WaitmS 1000Loop'220 bytes ...Some of the BASCOM Statements: Decision and structuresIF, THEN, ELSE, ELSEIF, END IF, DO, LOOP, WHILE, WEND, UNTIL, EXIT DO, EXIT WHILE, FOR, NEXT, TO, STEP, EXIT FOR, ON .. GOTO/GOSUB, SELECT, CASE. Input and outputPRINT, INPUT, INKEY, PRINT, INPUTHEX, LCD, UPPERLINE, LOWERLINE,DISPLAY ON/OFF, CURSOR ON/OFF/BLINK/NOBLINK, HOME, LOCATE, SHIFTLCD LEFT/RIGHT, SHIFTCURSOR LEFT/RIGHT, CLS, DEFLCDCHAR, WAITKEY, INPUTBIN, PRINTBIN, OPEN, CLOSE, DEBOUNCE, SHIFTIN, SHIFTOUT, GETATKBD, SPC, SERIN, SEROUTNumeric functionsAND, OR, XOR, INC, DEC, MOD, NOT, ABS, BCD, LOG, EXP, SQR, SIN,COS,TAN,ATN, ATN2, ASIN, ACOS, FIX, ROUND, MOD, SGN, POWER, RAD2DEG, DEG2RAD, LOG10, TANH, SINH, COSH.I2CI2CSTART, I2CSTOP, I2CWBYTE, I2CRBYTE, I2CSEND and I2CRECEIVE.1WIRE1WWRITE, 1WREAD, 1WRESET, 1WIRECOUNT, 1WSEARCHFIRST, 1WSEARCHNEXT.SPISPIINIT, SPIIN, SPIOUT, SPIMOVE.Interrupt programmingON INT0/INT1/TIMER0/TIMER1/SERIAL, RETURN, ENABLE, DISABLE, COUNTERx, CAPTUREx, INTERRUPTS, CONFIG, START, LOAD.Bit manipulationSET, RESET, ROTATE, SHIFT, BITWAIT, TOGGLE.VariablesDIM, BIT , BYTE , INTEGER , WORD, LONG, SINGLE, STRING , DEFBIT, DEFBYTE, DEFINT, DEFWORD.MiscellaneousREM, ' , SWAP, END, STOP, CONST, DELAY, WAIT, WAITMS, GOTO, GOSUB, POWERDOWN, IDLE, DECLARE, CALL, SUB, END SUB, MAKEDEC, MAKEBCD, INP,OUT, ALIAS, DIM , ERASE, DATA, READ, RESTORE, INCR, DECR, PEEK, POKE, CPEEK, FUNCTION, READMAGCARD, BIN2GREY, GREY2BIN, CRC8, CRC16, CHECKSUM.Compiler directives$INCLUDE, $BAUD and $CRYSTAL, $SERIALINPUT, $SERIALOUTPUT, $RAMSIZE, $RAMSTART, $DEFAULT XRAM, $ASM-$END ASM, $LCD, $EXTERNAL, $LIB.String manipulationSTRING, SPACE, LEFT, RIGHT, MID, VAL, HEXVAL, LEN, STR, HEX, LTRIM, RTRIM, TRIM, LCASE, UCASE, FORMAT, FUSING, INSTR.
It does not exactly find passages, tell middle of dorways etc?