Skip to content

RobotCing/Atmega8_IO_basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atmega8_IO_basic Library for robot Cing

This library allows robot Cing to be programmed easily.

For more information about this library please visit us at http://robotcing.wz.sk


Atmega Libraries Functions

Cing.RunMotor()

Description

Controls motor movement.

Syntax

Cing.RunMotor(motor,state,mode)

Parameters

motor: "A", "B", "AB"

state: 0 or 1 or -1 if digital mode is used. Positive values are used for forward, negative values are used for reverse.

mode: "digital"


Cing.ReadButtonExternal()

Description

Reads the value from external button, either 0 or 1.

Syntax

Cing.ReadButtonExternal()

Returns

0 if button is not pressed or 1 if button is pressed.


Cing.ReadButton()

Description

Reads the value from button, either 0 or 1. When pressed changes value of Cing.ReadShineArray(1) to 100.

Syntax

Cing.ReadButton()

Returns

0 if button is not pressed or 1 if button is pressed.


Cing.ReadPotentiometerExternal()

Description

Reads the value from external potentiometer.

Syntax

Cing.ReadPotentiometerExternal()

Returns

From 0 or 100 depending on potentiometer position.


Cing.ReadPotentiometer()

Description

Reads the value from potentiometer.

Syntax

Cing.ReadPotentiometer()

Returns

From 0 or 100 depending on potentiometer position.


Cing.ReadLightSensor()

Description

Reads the value from light sensor.

Syntax

Cing.ReadLightSensor(sensor,mode)

Parameters

sensor: 1 or 2 used for selection of sensor.

mode: "digital" or "analog"

Returns

From 0 to 100 in analog mode and either 0 or 1 in digital mode.


Cing.ReadShineSensor()

Description

Reads the value from external shine sensor.

Syntax

Cing.ReadShineSensor()

Returns

From 0 or 100 depending on ambient light.


Cing.ReadShineArray()

Description

Reads the value from external shine sensor.

Syntax

Cing.ReadShineArray(sensor)

Parameters

sensor: 1 or 2 used for selection of sensor.

Returns

From 0 or 100 depending on ambient light.

Cing.InitLed()


Cing.ReadUltrasonicSensor()

Description

Reads the value from external ultrasonic sensor.

Syntax

Cing.ReadUltrasonicSensor()

Returns

Distance in mm from 0 or 1. 1 means obstacle at distance lower then trigger distance(can be set by potentiometer) and 0 means no obstacle.


License

Copyright © 2019 RobotCing Team. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.